Search in sources :

Example 1 with AntlrDatatypeRuleToken

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

the class InternalContentAssistTestLanguageParser method entryRuleImportedFQN.

// $ANTLR end "ruleImport"
// $ANTLR start "entryRuleImportedFQN"
// InternalContentAssistTestLanguage.g:308:1: entryRuleImportedFQN returns [String current=null] : iv_ruleImportedFQN= ruleImportedFQN EOF ;
public final String entryRuleImportedFQN() throws RecognitionException {
    String current = null;
    AntlrDatatypeRuleToken iv_ruleImportedFQN = null;
    try {
        // InternalContentAssistTestLanguage.g:309:2: (iv_ruleImportedFQN= ruleImportedFQN EOF )
        // InternalContentAssistTestLanguage.g:310:2: iv_ruleImportedFQN= ruleImportedFQN EOF
        {
            newCompositeNode(grammarAccess.getImportedFQNRule());
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleImportedFQN = ruleImportedFQN();
            state._fsp--;
            current = iv_ruleImportedFQN.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 2 with AntlrDatatypeRuleToken

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

the class InternalContentAssistTestLanguageParser method ruleQN.

// $ANTLR end "entryRuleQN"
// $ANTLR start "ruleQN"
// InternalContentAssistTestLanguage.g:400:1: ruleQN returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* ) ;
public final AntlrDatatypeRuleToken ruleQN() throws RecognitionException {
    AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
    Token this_ID_0 = null;
    Token kw = null;
    Token this_ID_2 = null;
    enterRule();
    try {
        // InternalContentAssistTestLanguage.g:403:28: ( (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* ) )
        // InternalContentAssistTestLanguage.g:404:1: (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* )
        {
            // InternalContentAssistTestLanguage.g:404:1: (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* )
            // InternalContentAssistTestLanguage.g:404:6: this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )*
            {
                this_ID_0 = (Token) match(input, RULE_ID, FollowSets000.FOLLOW_8);
                current.merge(this_ID_0);
                newLeafNode(this_ID_0, grammarAccess.getQNAccess().getIDTerminalRuleCall_0());
                // InternalContentAssistTestLanguage.g:411:1: (kw= '.' this_ID_2= RULE_ID )*
                loop7: do {
                    int alt7 = 2;
                    int LA7_0 = input.LA(1);
                    if ((LA7_0 == 18)) {
                        alt7 = 1;
                    }
                    switch(alt7) {
                        case 1:
                            // InternalContentAssistTestLanguage.g:412:2: kw= '.' this_ID_2= RULE_ID
                            {
                                kw = (Token) match(input, 18, FollowSets000.FOLLOW_5);
                                current.merge(kw);
                                newLeafNode(kw, grammarAccess.getQNAccess().getFullStopKeyword_1_0());
                                this_ID_2 = (Token) match(input, RULE_ID, FollowSets000.FOLLOW_8);
                                current.merge(this_ID_2);
                                newLeafNode(this_ID_2, grammarAccess.getQNAccess().getIDTerminalRuleCall_1_1());
                            }
                            break;
                        default:
                            break loop7;
                    }
                } 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 3 with AntlrDatatypeRuleToken

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

the class InternalContentAssistTestLanguageParser method ruleImportedFQN.

// $ANTLR end "entryRuleImportedFQN"
// $ANTLR start "ruleImportedFQN"
// InternalContentAssistTestLanguage.g:317:1: ruleImportedFQN returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_FQN_0= ruleFQN (kw= '.*' )? ) ;
public final AntlrDatatypeRuleToken ruleImportedFQN() throws RecognitionException {
    AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
    Token kw = null;
    AntlrDatatypeRuleToken this_FQN_0 = null;
    enterRule();
    try {
        // InternalContentAssistTestLanguage.g:320:28: ( (this_FQN_0= ruleFQN (kw= '.*' )? ) )
        // InternalContentAssistTestLanguage.g:321:1: (this_FQN_0= ruleFQN (kw= '.*' )? )
        {
            // InternalContentAssistTestLanguage.g:321:1: (this_FQN_0= ruleFQN (kw= '.*' )? )
            // InternalContentAssistTestLanguage.g:322:5: this_FQN_0= ruleFQN (kw= '.*' )?
            {
                newCompositeNode(grammarAccess.getImportedFQNAccess().getFQNParserRuleCall_0());
                pushFollow(FollowSets000.FOLLOW_6);
                this_FQN_0 = ruleFQN();
                state._fsp--;
                current.merge(this_FQN_0);
                afterParserOrEnumRuleCall();
                // InternalContentAssistTestLanguage.g:332:1: (kw= '.*' )?
                int alt5 = 2;
                int LA5_0 = input.LA(1);
                if ((LA5_0 == 16)) {
                    alt5 = 1;
                }
                switch(alt5) {
                    case 1:
                        // InternalContentAssistTestLanguage.g:333:2: kw= '.*'
                        {
                            kw = (Token) match(input, 16, FollowSets000.FOLLOW_2);
                            current.merge(kw);
                            newLeafNode(kw, grammarAccess.getImportedFQNAccess().getFullStopAsteriskKeyword_1());
                        }
                        break;
                }
            }
        }
        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 4 with AntlrDatatypeRuleToken

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

the class InternalContentAssistTestLanguageParser method entryRuleFQN.

// $ANTLR end "ruleImportedFQN"
// $ANTLR start "entryRuleFQN"
// InternalContentAssistTestLanguage.g:346:1: entryRuleFQN returns [String current=null] : iv_ruleFQN= ruleFQN EOF ;
public final String entryRuleFQN() throws RecognitionException {
    String current = null;
    AntlrDatatypeRuleToken iv_ruleFQN = null;
    try {
        // InternalContentAssistTestLanguage.g:347:2: (iv_ruleFQN= ruleFQN EOF )
        // InternalContentAssistTestLanguage.g:348:2: iv_ruleFQN= ruleFQN EOF
        {
            newCompositeNode(grammarAccess.getFQNRule());
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleFQN = ruleFQN();
            state._fsp--;
            current = iv_ruleFQN.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 5 with AntlrDatatypeRuleToken

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

the class InternalContentAssistTestLanguageParser method ruleGenerateDirective.

// $ANTLR end "entryRuleGenerateDirective"
// $ANTLR start "ruleGenerateDirective"
// InternalContentAssistTestLanguage.g:231:1: ruleGenerateDirective returns [EObject current=null] : (otherlv_0= 'generate' ( (lv_typeName_1_0= ruleQN ) ) ) ;
public final EObject ruleGenerateDirective() throws RecognitionException {
    EObject current = null;
    Token otherlv_0 = null;
    AntlrDatatypeRuleToken lv_typeName_1_0 = null;
    enterRule();
    try {
        // InternalContentAssistTestLanguage.g:234:28: ( (otherlv_0= 'generate' ( (lv_typeName_1_0= ruleQN ) ) ) )
        // InternalContentAssistTestLanguage.g:235:1: (otherlv_0= 'generate' ( (lv_typeName_1_0= ruleQN ) ) )
        {
            // InternalContentAssistTestLanguage.g:235:1: (otherlv_0= 'generate' ( (lv_typeName_1_0= ruleQN ) ) )
            // InternalContentAssistTestLanguage.g:235:3: otherlv_0= 'generate' ( (lv_typeName_1_0= ruleQN ) )
            {
                otherlv_0 = (Token) match(input, 14, FollowSets000.FOLLOW_5);
                newLeafNode(otherlv_0, grammarAccess.getGenerateDirectiveAccess().getGenerateKeyword_0());
                // InternalContentAssistTestLanguage.g:239:1: ( (lv_typeName_1_0= ruleQN ) )
                // InternalContentAssistTestLanguage.g:240:1: (lv_typeName_1_0= ruleQN )
                {
                    // InternalContentAssistTestLanguage.g:240:1: (lv_typeName_1_0= ruleQN )
                    // InternalContentAssistTestLanguage.g:241:3: lv_typeName_1_0= ruleQN
                    {
                        newCompositeNode(grammarAccess.getGenerateDirectiveAccess().getTypeNameQNParserRuleCall_1_0());
                        pushFollow(FollowSets000.FOLLOW_2);
                        lv_typeName_1_0 = ruleQN();
                        state._fsp--;
                        if (current == null) {
                            current = createModelElementForParent(grammarAccess.getGenerateDirectiveRule());
                        }
                        set(current, "typeName", lv_typeName_1_0, "org.eclipse.xtext.common.types.xtext.ui.ContentAssistTestLanguage.QN");
                        afterParserOrEnumRuleCall();
                    }
                }
            }
        }
        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)

Aggregations

AntlrDatatypeRuleToken (org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)976 EObject (org.eclipse.emf.ecore.EObject)315 XtextTokenStream (org.eclipse.xtext.parser.antlr.XtextTokenStream)55 HiddenTokens (org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens)55 Enumerator (org.eclipse.emf.common.util.Enumerator)13 Test (org.junit.Test)10 CommonToken (org.antlr.runtime.CommonToken)3 UnorderedGroupState (org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper.UnorderedGroupState)3 DatatypeRuleToken (org.eclipse.xtext.parser.impl.DatatypeRuleToken)2