Search in sources :

Example 81 with AntlrDatatypeRuleToken

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

the class InternalXtextGrammarTestLanguageParser method ruleRuleID.

// $ANTLR end "entryRuleRuleID"
// $ANTLR start "ruleRuleID"
// InternalXtextGrammarTestLanguage.g:1788:1: ruleRuleID returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_ID_0= RULE_ID (kw= '::' this_ID_2= RULE_ID )* ) ;
public final AntlrDatatypeRuleToken ruleRuleID() throws RecognitionException {
    AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
    Token this_ID_0 = null;
    Token kw = null;
    Token this_ID_2 = null;
    enterRule();
    try {
        // InternalXtextGrammarTestLanguage.g:1794:2: ( (this_ID_0= RULE_ID (kw= '::' this_ID_2= RULE_ID )* ) )
        // InternalXtextGrammarTestLanguage.g:1795:2: (this_ID_0= RULE_ID (kw= '::' this_ID_2= RULE_ID )* )
        {
            // InternalXtextGrammarTestLanguage.g:1795:2: (this_ID_0= RULE_ID (kw= '::' this_ID_2= RULE_ID )* )
            // InternalXtextGrammarTestLanguage.g:1796:3: this_ID_0= RULE_ID (kw= '::' this_ID_2= RULE_ID )*
            {
                this_ID_0 = (Token) match(input, RULE_ID, FollowSets000.FOLLOW_37);
                current.merge(this_ID_0);
                newLeafNode(this_ID_0, grammarAccess.getRuleIDAccess().getIDTerminalRuleCall_0());
                // InternalXtextGrammarTestLanguage.g:1803:3: (kw= '::' this_ID_2= RULE_ID )*
                loop41: do {
                    int alt41 = 2;
                    int LA41_0 = input.LA(1);
                    if ((LA41_0 == 28)) {
                        alt41 = 1;
                    }
                    switch(alt41) {
                        case 1:
                            // InternalXtextGrammarTestLanguage.g:1804:4: kw= '::' this_ID_2= RULE_ID
                            {
                                kw = (Token) match(input, 28, FollowSets000.FOLLOW_3);
                                current.merge(kw);
                                newLeafNode(kw, grammarAccess.getRuleIDAccess().getColonColonKeyword_1_0());
                                this_ID_2 = (Token) match(input, RULE_ID, FollowSets000.FOLLOW_37);
                                current.merge(this_ID_2);
                                newLeafNode(this_ID_2, grammarAccess.getRuleIDAccess().getIDTerminalRuleCall_1_1());
                            }
                            break;
                        default:
                            break loop41;
                    }
                } while (true);
            }
        }
        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 82 with AntlrDatatypeRuleToken

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

the class InternalXtextGrammarTestLanguageParser method entryRuleGrammarID.

// $ANTLR end "ruleHiddenClause"
// $ANTLR start "entryRuleGrammarID"
// InternalXtextGrammarTestLanguage.g:270:1: entryRuleGrammarID returns [String current=null] : iv_ruleGrammarID= ruleGrammarID EOF ;
public final String entryRuleGrammarID() throws RecognitionException {
    String current = null;
    AntlrDatatypeRuleToken iv_ruleGrammarID = null;
    try {
        // InternalXtextGrammarTestLanguage.g:270:49: (iv_ruleGrammarID= ruleGrammarID EOF )
        // InternalXtextGrammarTestLanguage.g:271:2: iv_ruleGrammarID= ruleGrammarID EOF
        {
            newCompositeNode(grammarAccess.getGrammarIDRule());
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleGrammarID = ruleGrammarID();
            state._fsp--;
            current = iv_ruleGrammarID.getText();
            match(input, EOF, FollowSets000.FOLLOW_2);
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)

Example 83 with AntlrDatatypeRuleToken

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

the class InternalXtextGrammarTestLanguageParser method ruleGrammarID.

// $ANTLR end "entryRuleGrammarID"
// $ANTLR start "ruleGrammarID"
// InternalXtextGrammarTestLanguage.g:277:1: ruleGrammarID returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* ) ;
public final AntlrDatatypeRuleToken ruleGrammarID() throws RecognitionException {
    AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
    Token this_ID_0 = null;
    Token kw = null;
    Token this_ID_2 = null;
    enterRule();
    try {
        // InternalXtextGrammarTestLanguage.g:283:2: ( (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* ) )
        // InternalXtextGrammarTestLanguage.g:284:2: (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* )
        {
            // InternalXtextGrammarTestLanguage.g:284:2: (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* )
            // InternalXtextGrammarTestLanguage.g:285:3: this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )*
            {
                this_ID_0 = (Token) match(input, RULE_ID, FollowSets000.FOLLOW_10);
                current.merge(this_ID_0);
                newLeafNode(this_ID_0, grammarAccess.getGrammarIDAccess().getIDTerminalRuleCall_0());
                // InternalXtextGrammarTestLanguage.g:292:3: (kw= '.' this_ID_2= RULE_ID )*
                loop8: do {
                    int alt8 = 2;
                    int LA8_0 = input.LA(1);
                    if ((LA8_0 == 17)) {
                        alt8 = 1;
                    }
                    switch(alt8) {
                        case 1:
                            // InternalXtextGrammarTestLanguage.g:293:4: kw= '.' this_ID_2= RULE_ID
                            {
                                kw = (Token) match(input, 17, FollowSets000.FOLLOW_3);
                                current.merge(kw);
                                newLeafNode(kw, grammarAccess.getGrammarIDAccess().getFullStopKeyword_1_0());
                                this_ID_2 = (Token) match(input, RULE_ID, FollowSets000.FOLLOW_10);
                                current.merge(this_ID_2);
                                newLeafNode(this_ID_2, grammarAccess.getGrammarIDAccess().getIDTerminalRuleCall_1_1());
                            }
                            break;
                        default:
                            break loop8;
                    }
                } while (true);
            }
        }
        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 84 with AntlrDatatypeRuleToken

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

the class InternalXtextGrammarTestLanguageParser method ruleGrammar.

// $ANTLR end "entryRuleGrammar"
// $ANTLR start "ruleGrammar"
// InternalXtextGrammarTestLanguage.g:71:1: ruleGrammar returns [EObject current=null] : (otherlv_0= 'grammar' ( (lv_name_1_0= ruleGrammarID ) ) (otherlv_2= 'with' ( ( ruleGrammarID ) ) (otherlv_4= ',' ( ( ruleGrammarID ) ) )* )? (this_HiddenClause_6= ruleHiddenClause[$current] )? ( (lv_metamodelDeclarations_7_0= ruleAbstractMetamodelDeclaration ) )* ( (lv_rules_8_0= ruleAbstractRule ) )+ ) ;
public final EObject ruleGrammar() throws RecognitionException {
    EObject current = null;
    Token otherlv_0 = null;
    Token otherlv_2 = null;
    Token otherlv_4 = null;
    AntlrDatatypeRuleToken lv_name_1_0 = null;
    EObject this_HiddenClause_6 = null;
    EObject lv_metamodelDeclarations_7_0 = null;
    EObject lv_rules_8_0 = null;
    enterRule();
    try {
        // InternalXtextGrammarTestLanguage.g:77:2: ( (otherlv_0= 'grammar' ( (lv_name_1_0= ruleGrammarID ) ) (otherlv_2= 'with' ( ( ruleGrammarID ) ) (otherlv_4= ',' ( ( ruleGrammarID ) ) )* )? (this_HiddenClause_6= ruleHiddenClause[$current] )? ( (lv_metamodelDeclarations_7_0= ruleAbstractMetamodelDeclaration ) )* ( (lv_rules_8_0= ruleAbstractRule ) )+ ) )
        // InternalXtextGrammarTestLanguage.g:78:2: (otherlv_0= 'grammar' ( (lv_name_1_0= ruleGrammarID ) ) (otherlv_2= 'with' ( ( ruleGrammarID ) ) (otherlv_4= ',' ( ( ruleGrammarID ) ) )* )? (this_HiddenClause_6= ruleHiddenClause[$current] )? ( (lv_metamodelDeclarations_7_0= ruleAbstractMetamodelDeclaration ) )* ( (lv_rules_8_0= ruleAbstractRule ) )+ )
        {
            // InternalXtextGrammarTestLanguage.g:78:2: (otherlv_0= 'grammar' ( (lv_name_1_0= ruleGrammarID ) ) (otherlv_2= 'with' ( ( ruleGrammarID ) ) (otherlv_4= ',' ( ( ruleGrammarID ) ) )* )? (this_HiddenClause_6= ruleHiddenClause[$current] )? ( (lv_metamodelDeclarations_7_0= ruleAbstractMetamodelDeclaration ) )* ( (lv_rules_8_0= ruleAbstractRule ) )+ )
            // InternalXtextGrammarTestLanguage.g:79:3: otherlv_0= 'grammar' ( (lv_name_1_0= ruleGrammarID ) ) (otherlv_2= 'with' ( ( ruleGrammarID ) ) (otherlv_4= ',' ( ( ruleGrammarID ) ) )* )? (this_HiddenClause_6= ruleHiddenClause[$current] )? ( (lv_metamodelDeclarations_7_0= ruleAbstractMetamodelDeclaration ) )* ( (lv_rules_8_0= ruleAbstractRule ) )+
            {
                otherlv_0 = (Token) match(input, 11, FollowSets000.FOLLOW_3);
                newLeafNode(otherlv_0, grammarAccess.getGrammarAccess().getGrammarKeyword_0());
                // InternalXtextGrammarTestLanguage.g:83:3: ( (lv_name_1_0= ruleGrammarID ) )
                // InternalXtextGrammarTestLanguage.g:84:4: (lv_name_1_0= ruleGrammarID )
                {
                    // InternalXtextGrammarTestLanguage.g:84:4: (lv_name_1_0= ruleGrammarID )
                    // InternalXtextGrammarTestLanguage.g:85:5: lv_name_1_0= ruleGrammarID
                    {
                        newCompositeNode(grammarAccess.getGrammarAccess().getNameGrammarIDParserRuleCall_1_0());
                        pushFollow(FollowSets000.FOLLOW_4);
                        lv_name_1_0 = ruleGrammarID();
                        state._fsp--;
                        if (current == null) {
                            current = createModelElementForParent(grammarAccess.getGrammarRule());
                        }
                        set(current, "name", lv_name_1_0, "org.eclipse.xtext.XtextGrammarTestLanguage.GrammarID");
                        afterParserOrEnumRuleCall();
                    }
                }
                // InternalXtextGrammarTestLanguage.g:102:3: (otherlv_2= 'with' ( ( ruleGrammarID ) ) (otherlv_4= ',' ( ( ruleGrammarID ) ) )* )?
                int alt2 = 2;
                int LA2_0 = input.LA(1);
                if ((LA2_0 == 12)) {
                    alt2 = 1;
                }
                switch(alt2) {
                    case 1:
                        // InternalXtextGrammarTestLanguage.g:103:4: otherlv_2= 'with' ( ( ruleGrammarID ) ) (otherlv_4= ',' ( ( ruleGrammarID ) ) )*
                        {
                            otherlv_2 = (Token) match(input, 12, FollowSets000.FOLLOW_3);
                            newLeafNode(otherlv_2, grammarAccess.getGrammarAccess().getWithKeyword_2_0());
                            // InternalXtextGrammarTestLanguage.g:107:4: ( ( ruleGrammarID ) )
                            // InternalXtextGrammarTestLanguage.g:108:5: ( ruleGrammarID )
                            {
                                // InternalXtextGrammarTestLanguage.g:108:5: ( ruleGrammarID )
                                // InternalXtextGrammarTestLanguage.g:109:6: ruleGrammarID
                                {
                                    if (current == null) {
                                        current = createModelElement(grammarAccess.getGrammarRule());
                                    }
                                    newCompositeNode(grammarAccess.getGrammarAccess().getUsedGrammarsGrammarCrossReference_2_1_0());
                                    pushFollow(FollowSets000.FOLLOW_5);
                                    ruleGrammarID();
                                    state._fsp--;
                                    afterParserOrEnumRuleCall();
                                }
                            }
                            // InternalXtextGrammarTestLanguage.g:123:4: (otherlv_4= ',' ( ( ruleGrammarID ) ) )*
                            loop1: do {
                                int alt1 = 2;
                                int LA1_0 = input.LA(1);
                                if ((LA1_0 == 13)) {
                                    alt1 = 1;
                                }
                                switch(alt1) {
                                    case 1:
                                        // InternalXtextGrammarTestLanguage.g:124:5: otherlv_4= ',' ( ( ruleGrammarID ) )
                                        {
                                            otherlv_4 = (Token) match(input, 13, FollowSets000.FOLLOW_3);
                                            newLeafNode(otherlv_4, grammarAccess.getGrammarAccess().getCommaKeyword_2_2_0());
                                            // InternalXtextGrammarTestLanguage.g:128:5: ( ( ruleGrammarID ) )
                                            // InternalXtextGrammarTestLanguage.g:129:6: ( ruleGrammarID )
                                            {
                                                // InternalXtextGrammarTestLanguage.g:129:6: ( ruleGrammarID )
                                                // InternalXtextGrammarTestLanguage.g:130:7: ruleGrammarID
                                                {
                                                    if (current == null) {
                                                        current = createModelElement(grammarAccess.getGrammarRule());
                                                    }
                                                    newCompositeNode(grammarAccess.getGrammarAccess().getUsedGrammarsGrammarCrossReference_2_2_1_0());
                                                    pushFollow(FollowSets000.FOLLOW_5);
                                                    ruleGrammarID();
                                                    state._fsp--;
                                                    afterParserOrEnumRuleCall();
                                                }
                                            }
                                        }
                                        break;
                                    default:
                                        break loop1;
                                }
                            } while (true);
                        }
                        break;
                }
                // InternalXtextGrammarTestLanguage.g:146:3: (this_HiddenClause_6= ruleHiddenClause[$current] )?
                int alt3 = 2;
                int LA3_0 = input.LA(1);
                if ((LA3_0 == 14)) {
                    alt3 = 1;
                }
                switch(alt3) {
                    case 1:
                        // InternalXtextGrammarTestLanguage.g:147:4: this_HiddenClause_6= ruleHiddenClause[$current]
                        {
                            if (current == null) {
                                current = createModelElement(grammarAccess.getGrammarRule());
                            }
                            newCompositeNode(grammarAccess.getGrammarAccess().getHiddenClauseParserRuleCall_3());
                            pushFollow(FollowSets000.FOLLOW_4);
                            this_HiddenClause_6 = ruleHiddenClause(current);
                            state._fsp--;
                            current = this_HiddenClause_6;
                            afterParserOrEnumRuleCall();
                        }
                        break;
                }
                // InternalXtextGrammarTestLanguage.g:159:3: ( (lv_metamodelDeclarations_7_0= ruleAbstractMetamodelDeclaration ) )*
                loop4: do {
                    int alt4 = 2;
                    int LA4_0 = input.LA(1);
                    if ((LA4_0 == 18 || LA4_0 == 20)) {
                        alt4 = 1;
                    }
                    switch(alt4) {
                        case 1:
                            // InternalXtextGrammarTestLanguage.g:160:4: (lv_metamodelDeclarations_7_0= ruleAbstractMetamodelDeclaration )
                            {
                                // InternalXtextGrammarTestLanguage.g:160:4: (lv_metamodelDeclarations_7_0= ruleAbstractMetamodelDeclaration )
                                // InternalXtextGrammarTestLanguage.g:161:5: lv_metamodelDeclarations_7_0= ruleAbstractMetamodelDeclaration
                                {
                                    newCompositeNode(grammarAccess.getGrammarAccess().getMetamodelDeclarationsAbstractMetamodelDeclarationParserRuleCall_4_0());
                                    pushFollow(FollowSets000.FOLLOW_4);
                                    lv_metamodelDeclarations_7_0 = ruleAbstractMetamodelDeclaration();
                                    state._fsp--;
                                    if (current == null) {
                                        current = createModelElementForParent(grammarAccess.getGrammarRule());
                                    }
                                    add(current, "metamodelDeclarations", lv_metamodelDeclarations_7_0, "org.eclipse.xtext.XtextGrammarTestLanguage.AbstractMetamodelDeclaration");
                                    afterParserOrEnumRuleCall();
                                }
                            }
                            break;
                        default:
                            break loop4;
                    }
                } while (true);
                // InternalXtextGrammarTestLanguage.g:178:3: ( (lv_rules_8_0= ruleAbstractRule ) )+
                int cnt5 = 0;
                loop5: do {
                    int alt5 = 2;
                    int LA5_0 = input.LA(1);
                    if ((LA5_0 == RULE_ID || LA5_0 == 21 || LA5_0 == 42 || LA5_0 == 45)) {
                        alt5 = 1;
                    }
                    switch(alt5) {
                        case 1:
                            // InternalXtextGrammarTestLanguage.g:179:4: (lv_rules_8_0= ruleAbstractRule )
                            {
                                // InternalXtextGrammarTestLanguage.g:179:4: (lv_rules_8_0= ruleAbstractRule )
                                // InternalXtextGrammarTestLanguage.g:180:5: lv_rules_8_0= ruleAbstractRule
                                {
                                    newCompositeNode(grammarAccess.getGrammarAccess().getRulesAbstractRuleParserRuleCall_5_0());
                                    pushFollow(FollowSets000.FOLLOW_6);
                                    lv_rules_8_0 = ruleAbstractRule();
                                    state._fsp--;
                                    if (current == null) {
                                        current = createModelElementForParent(grammarAccess.getGrammarRule());
                                    }
                                    add(current, "rules", lv_rules_8_0, "org.eclipse.xtext.XtextGrammarTestLanguage.AbstractRule");
                                    afterParserOrEnumRuleCall();
                                }
                            }
                            break;
                        default:
                            if (cnt5 >= 1)
                                break loop5;
                            EarlyExitException eee = new EarlyExitException(5, input);
                            throw eee;
                    }
                    cnt5++;
                } while (true);
            }
        }
        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 85 with AntlrDatatypeRuleToken

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

the class InternalXtextGrammarTestLanguageParser method entryRuleInverseLiteralValue.

// $ANTLR end "ruleLiteralValue"
// $ANTLR start "entryRuleInverseLiteralValue"
// InternalXtextGrammarTestLanguage.g:1626:1: entryRuleInverseLiteralValue returns [String current=null] : iv_ruleInverseLiteralValue= ruleInverseLiteralValue EOF ;
public final String entryRuleInverseLiteralValue() throws RecognitionException {
    String current = null;
    AntlrDatatypeRuleToken iv_ruleInverseLiteralValue = null;
    try {
        // InternalXtextGrammarTestLanguage.g:1626:59: (iv_ruleInverseLiteralValue= ruleInverseLiteralValue EOF )
        // InternalXtextGrammarTestLanguage.g:1627:2: iv_ruleInverseLiteralValue= ruleInverseLiteralValue EOF
        {
            newCompositeNode(grammarAccess.getInverseLiteralValueRule());
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleInverseLiteralValue = ruleInverseLiteralValue();
            state._fsp--;
            current = iv_ruleInverseLiteralValue.getText();
            match(input, EOF, FollowSets000.FOLLOW_2);
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : 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