Search in sources :

Example 41 with XtextTokenStream

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

the class InternalSimpleBeeLangTestLanguageParser method entryRuleQID.

// $ANTLR end "ruleParanthesizedExpression"
// $ANTLR start "entryRuleQID"
// InternalSimpleBeeLangTestLanguage.g:5412:1: entryRuleQID returns [String current=null] : iv_ruleQID= ruleQID EOF ;
public final String entryRuleQID() throws RecognitionException {
    String current = null;
    int entryRuleQID_StartIndex = input.index();
    AntlrDatatypeRuleToken iv_ruleQID = null;
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens();
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 113)) {
            return current;
        }
        // InternalSimpleBeeLangTestLanguage.g:5414:2: (iv_ruleQID= ruleQID EOF )
        // InternalSimpleBeeLangTestLanguage.g:5415:2: iv_ruleQID= ruleQID EOF
        {
            if (state.backtracking == 0) {
                newCompositeNode(grammarAccess.getQIDRule());
            }
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleQID = ruleQID();
            state._fsp--;
            if (state.failed)
                return current;
            if (state.backtracking == 0) {
                current = iv_ruleQID.getText();
            }
            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, 113, entryRuleQID_StartIndex);
        }
        myHiddenTokenState.restore();
    }
    return current;
}
Also used : XtextTokenStream(org.eclipse.xtext.parser.antlr.XtextTokenStream) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken) HiddenTokens(org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens)

Example 42 with XtextTokenStream

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

the class InternalBeeLangTestLanguageParser method ruleQID.

// $ANTLR end "entryRuleQID"
// $ANTLR start "ruleQID"
// InternalBeeLangTestLanguage.g:5396:1: ruleQID returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_ID_0= RULE_ID (this_INT_1= RULE_INT | this_HEX_2= RULE_HEX | this_ID_3= RULE_ID )* (kw= '.' this_ID_5= RULE_ID (this_INT_6= RULE_INT | this_HEX_7= RULE_HEX | this_ID_8= RULE_ID )* )* ) ;
public final AntlrDatatypeRuleToken ruleQID() throws RecognitionException {
    AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
    int ruleQID_StartIndex = input.index();
    Token this_ID_0 = null;
    Token this_INT_1 = null;
    Token this_HEX_2 = null;
    Token this_ID_3 = null;
    Token kw = null;
    Token this_ID_5 = null;
    Token this_INT_6 = null;
    Token this_HEX_7 = null;
    Token this_ID_8 = null;
    enterRule();
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens();
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 112)) {
            return current;
        }
        // InternalBeeLangTestLanguage.g:5403:2: ( (this_ID_0= RULE_ID (this_INT_1= RULE_INT | this_HEX_2= RULE_HEX | this_ID_3= RULE_ID )* (kw= '.' this_ID_5= RULE_ID (this_INT_6= RULE_INT | this_HEX_7= RULE_HEX | this_ID_8= RULE_ID )* )* ) )
        // InternalBeeLangTestLanguage.g:5404:2: (this_ID_0= RULE_ID (this_INT_1= RULE_INT | this_HEX_2= RULE_HEX | this_ID_3= RULE_ID )* (kw= '.' this_ID_5= RULE_ID (this_INT_6= RULE_INT | this_HEX_7= RULE_HEX | this_ID_8= RULE_ID )* )* )
        {
            // InternalBeeLangTestLanguage.g:5404:2: (this_ID_0= RULE_ID (this_INT_1= RULE_INT | this_HEX_2= RULE_HEX | this_ID_3= RULE_ID )* (kw= '.' this_ID_5= RULE_ID (this_INT_6= RULE_INT | this_HEX_7= RULE_HEX | this_ID_8= RULE_ID )* )* )
            // InternalBeeLangTestLanguage.g:5405:3: this_ID_0= RULE_ID (this_INT_1= RULE_INT | this_HEX_2= RULE_HEX | this_ID_3= RULE_ID )* (kw= '.' this_ID_5= RULE_ID (this_INT_6= RULE_INT | this_HEX_7= RULE_HEX | this_ID_8= RULE_ID )* )*
            {
                this_ID_0 = (Token) match(input, RULE_ID, FOLLOW_76);
                if (state.failed)
                    return current;
                if (state.backtracking == 0) {
                    current.merge(this_ID_0);
                }
                if (state.backtracking == 0) {
                    newLeafNode(this_ID_0, grammarAccess.getQIDAccess().getIDTerminalRuleCall_0());
                }
                // InternalBeeLangTestLanguage.g:5412:3: (this_INT_1= RULE_INT | this_HEX_2= RULE_HEX | this_ID_3= RULE_ID )*
                loop93: do {
                    int alt93 = 4;
                    switch(input.LA(1)) {
                        case RULE_INT:
                            {
                                alt93 = 1;
                            }
                            break;
                        case RULE_HEX:
                            {
                                alt93 = 2;
                            }
                            break;
                        case RULE_ID:
                            {
                                alt93 = 3;
                            }
                            break;
                    }
                    switch(alt93) {
                        case 1:
                            // InternalBeeLangTestLanguage.g:5413:4: this_INT_1= RULE_INT
                            {
                                this_INT_1 = (Token) match(input, RULE_INT, FOLLOW_76);
                                if (state.failed)
                                    return current;
                                if (state.backtracking == 0) {
                                    current.merge(this_INT_1);
                                }
                                if (state.backtracking == 0) {
                                    newLeafNode(this_INT_1, grammarAccess.getQIDAccess().getINTTerminalRuleCall_1_0());
                                }
                            }
                            break;
                        case 2:
                            // InternalBeeLangTestLanguage.g:5421:4: this_HEX_2= RULE_HEX
                            {
                                this_HEX_2 = (Token) match(input, RULE_HEX, FOLLOW_76);
                                if (state.failed)
                                    return current;
                                if (state.backtracking == 0) {
                                    current.merge(this_HEX_2);
                                }
                                if (state.backtracking == 0) {
                                    newLeafNode(this_HEX_2, grammarAccess.getQIDAccess().getHEXTerminalRuleCall_1_1());
                                }
                            }
                            break;
                        case 3:
                            // InternalBeeLangTestLanguage.g:5429:4: this_ID_3= RULE_ID
                            {
                                this_ID_3 = (Token) match(input, RULE_ID, FOLLOW_76);
                                if (state.failed)
                                    return current;
                                if (state.backtracking == 0) {
                                    current.merge(this_ID_3);
                                }
                                if (state.backtracking == 0) {
                                    newLeafNode(this_ID_3, grammarAccess.getQIDAccess().getIDTerminalRuleCall_1_2());
                                }
                            }
                            break;
                        default:
                            break loop93;
                    }
                } while (true);
                // InternalBeeLangTestLanguage.g:5437:3: (kw= '.' this_ID_5= RULE_ID (this_INT_6= RULE_INT | this_HEX_7= RULE_HEX | this_ID_8= RULE_ID )* )*
                loop95: do {
                    int alt95 = 2;
                    int LA95_0 = input.LA(1);
                    if ((LA95_0 == 67)) {
                        alt95 = 1;
                    }
                    switch(alt95) {
                        case 1:
                            // InternalBeeLangTestLanguage.g:5438:4: kw= '.' this_ID_5= RULE_ID (this_INT_6= RULE_INT | this_HEX_7= RULE_HEX | this_ID_8= RULE_ID )*
                            {
                                kw = (Token) match(input, 67, FOLLOW_8);
                                if (state.failed)
                                    return current;
                                if (state.backtracking == 0) {
                                    current.merge(kw);
                                    newLeafNode(kw, grammarAccess.getQIDAccess().getFullStopKeyword_2_0());
                                }
                                this_ID_5 = (Token) match(input, RULE_ID, FOLLOW_76);
                                if (state.failed)
                                    return current;
                                if (state.backtracking == 0) {
                                    current.merge(this_ID_5);
                                }
                                if (state.backtracking == 0) {
                                    newLeafNode(this_ID_5, grammarAccess.getQIDAccess().getIDTerminalRuleCall_2_1());
                                }
                                // InternalBeeLangTestLanguage.g:5450:4: (this_INT_6= RULE_INT | this_HEX_7= RULE_HEX | this_ID_8= RULE_ID )*
                                loop94: do {
                                    int alt94 = 4;
                                    switch(input.LA(1)) {
                                        case RULE_INT:
                                            {
                                                alt94 = 1;
                                            }
                                            break;
                                        case RULE_HEX:
                                            {
                                                alt94 = 2;
                                            }
                                            break;
                                        case RULE_ID:
                                            {
                                                alt94 = 3;
                                            }
                                            break;
                                    }
                                    switch(alt94) {
                                        case 1:
                                            // InternalBeeLangTestLanguage.g:5451:5: this_INT_6= RULE_INT
                                            {
                                                this_INT_6 = (Token) match(input, RULE_INT, FOLLOW_76);
                                                if (state.failed)
                                                    return current;
                                                if (state.backtracking == 0) {
                                                    current.merge(this_INT_6);
                                                }
                                                if (state.backtracking == 0) {
                                                    newLeafNode(this_INT_6, grammarAccess.getQIDAccess().getINTTerminalRuleCall_2_2_0());
                                                }
                                            }
                                            break;
                                        case 2:
                                            // InternalBeeLangTestLanguage.g:5459:5: this_HEX_7= RULE_HEX
                                            {
                                                this_HEX_7 = (Token) match(input, RULE_HEX, FOLLOW_76);
                                                if (state.failed)
                                                    return current;
                                                if (state.backtracking == 0) {
                                                    current.merge(this_HEX_7);
                                                }
                                                if (state.backtracking == 0) {
                                                    newLeafNode(this_HEX_7, grammarAccess.getQIDAccess().getHEXTerminalRuleCall_2_2_1());
                                                }
                                            }
                                            break;
                                        case 3:
                                            // InternalBeeLangTestLanguage.g:5467:5: this_ID_8= RULE_ID
                                            {
                                                this_ID_8 = (Token) match(input, RULE_ID, FOLLOW_76);
                                                if (state.failed)
                                                    return current;
                                                if (state.backtracking == 0) {
                                                    current.merge(this_ID_8);
                                                }
                                                if (state.backtracking == 0) {
                                                    newLeafNode(this_ID_8, grammarAccess.getQIDAccess().getIDTerminalRuleCall_2_2_2());
                                                }
                                            }
                                            break;
                                        default:
                                            break loop94;
                                    }
                                } while (true);
                            }
                            break;
                        default:
                            break loop95;
                    }
                } while (true);
            }
        }
        if (state.backtracking == 0) {
            leaveRule();
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        if (state.backtracking > 0) {
            memoize(input, 112, ruleQID_StartIndex);
        }
        myHiddenTokenState.restore();
    }
    return current;
}
Also used : XtextTokenStream(org.eclipse.xtext.parser.antlr.XtextTokenStream) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken) HiddenTokens(org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens)

Example 43 with XtextTokenStream

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

the class InternalBeeLangTestLanguageParser method entryRulePath.

// $ANTLR end "ruleRequiredCapability"
// $ANTLR start "entryRulePath"
// InternalBeeLangTestLanguage.g:1386:1: entryRulePath returns [String current=null] : iv_rulePath= rulePath EOF ;
public final String entryRulePath() throws RecognitionException {
    String current = null;
    int entryRulePath_StartIndex = input.index();
    AntlrDatatypeRuleToken iv_rulePath = null;
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens();
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 11)) {
            return current;
        }
        // InternalBeeLangTestLanguage.g:1388:2: (iv_rulePath= rulePath EOF )
        // InternalBeeLangTestLanguage.g:1389:2: iv_rulePath= rulePath EOF
        {
            if (state.backtracking == 0) {
                newCompositeNode(grammarAccess.getPathRule());
            }
            pushFollow(FOLLOW_1);
            iv_rulePath = rulePath();
            state._fsp--;
            if (state.failed)
                return current;
            if (state.backtracking == 0) {
                current = iv_rulePath.getText();
            }
            match(input, EOF, FOLLOW_2);
            if (state.failed)
                return current;
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        if (state.backtracking > 0) {
            memoize(input, 11, entryRulePath_StartIndex);
        }
        myHiddenTokenState.restore();
    }
    return current;
}
Also used : XtextTokenStream(org.eclipse.xtext.parser.antlr.XtextTokenStream) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken) HiddenTokens(org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens)

Example 44 with XtextTokenStream

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

the class InternalBeeLangTestLanguageParser method entryRuleQID.

// $ANTLR end "ruleParanthesizedExpression"
// $ANTLR start "entryRuleQID"
// InternalBeeLangTestLanguage.g:5384:1: entryRuleQID returns [String current=null] : iv_ruleQID= ruleQID EOF ;
public final String entryRuleQID() throws RecognitionException {
    String current = null;
    int entryRuleQID_StartIndex = input.index();
    AntlrDatatypeRuleToken iv_ruleQID = null;
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens();
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 111)) {
            return current;
        }
        // InternalBeeLangTestLanguage.g:5386:2: (iv_ruleQID= ruleQID EOF )
        // InternalBeeLangTestLanguage.g:5387:2: iv_ruleQID= ruleQID EOF
        {
            if (state.backtracking == 0) {
                newCompositeNode(grammarAccess.getQIDRule());
            }
            pushFollow(FOLLOW_1);
            iv_ruleQID = ruleQID();
            state._fsp--;
            if (state.failed)
                return current;
            if (state.backtracking == 0) {
                current = iv_ruleQID.getText();
            }
            match(input, EOF, FOLLOW_2);
            if (state.failed)
                return current;
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        if (state.backtracking > 0) {
            memoize(input, 111, entryRuleQID_StartIndex);
        }
        myHiddenTokenState.restore();
    }
    return current;
}
Also used : XtextTokenStream(org.eclipse.xtext.parser.antlr.XtextTokenStream) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken) HiddenTokens(org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens)

Aggregations

XtextTokenStream (org.eclipse.xtext.parser.antlr.XtextTokenStream)44 HiddenTokens (org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens)42 AntlrDatatypeRuleToken (org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)34 EObject (org.eclipse.emf.ecore.EObject)16 Token (org.antlr.runtime.Token)2 StringReader (java.io.StringReader)1 ANTLRStringStream (org.antlr.runtime.ANTLRStringStream)1 CharStream (org.antlr.runtime.CharStream)1 FlexTokenSource (org.eclipse.xtend.core.parser.antlr.internal.FlexTokenSource)1 FlexerFactory (org.eclipse.xtend.core.parser.antlr.internal.FlexerFactory)1 InternalXtendLexer (org.eclipse.xtend.core.parser.antlr.internal.InternalXtendLexer)1 Lexer (org.eclipse.xtext.parser.antlr.Lexer)1