Search in sources :

Example 31 with XtextTokenStream

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

the class InternalBug292245TestLanguageParser method entryRuleRehide.

// $ANTLR end "ruleApostrophe"
// $ANTLR start "entryRuleRehide"
// InternalBug292245TestLanguage.g:316:1: entryRuleRehide returns [String current=null] : iv_ruleRehide= ruleRehide EOF ;
public final String entryRuleRehide() throws RecognitionException {
    String current = null;
    AntlrDatatypeRuleToken iv_ruleRehide = null;
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens("RULE_WS");
    try {
        // InternalBug292245TestLanguage.g:318:2: (iv_ruleRehide= ruleRehide EOF )
        // InternalBug292245TestLanguage.g:319:2: iv_ruleRehide= ruleRehide EOF
        {
            newCompositeNode(grammarAccess.getRehideRule());
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleRehide = ruleRehide();
            state._fsp--;
            current = iv_ruleRehide.getText();
            match(input, EOF, FollowSets000.FOLLOW_2);
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        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 32 with XtextTokenStream

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

the class InternalBug292245TestLanguageParser method ruleFix.

// $ANTLR end "entryRuleFix"
// $ANTLR start "ruleFix"
// InternalBug292245TestLanguage.g:233:1: ruleFix returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_APOSTROPHE_CHAR_0= RULE_APOSTROPHE_CHAR this_Graphical_1= ruleGraphical this_APOSTROPHE_CHAR_2= RULE_APOSTROPHE_CHAR this_Rehide_3= ruleRehide ) ;
public final AntlrDatatypeRuleToken ruleFix() throws RecognitionException {
    AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
    Token this_APOSTROPHE_CHAR_0 = null;
    Token this_APOSTROPHE_CHAR_2 = null;
    AntlrDatatypeRuleToken this_Graphical_1 = null;
    AntlrDatatypeRuleToken this_Rehide_3 = null;
    enterRule();
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens();
    try {
        // InternalBug292245TestLanguage.g:240:2: ( (this_APOSTROPHE_CHAR_0= RULE_APOSTROPHE_CHAR this_Graphical_1= ruleGraphical this_APOSTROPHE_CHAR_2= RULE_APOSTROPHE_CHAR this_Rehide_3= ruleRehide ) )
        // InternalBug292245TestLanguage.g:241:2: (this_APOSTROPHE_CHAR_0= RULE_APOSTROPHE_CHAR this_Graphical_1= ruleGraphical this_APOSTROPHE_CHAR_2= RULE_APOSTROPHE_CHAR this_Rehide_3= ruleRehide )
        {
            // InternalBug292245TestLanguage.g:241:2: (this_APOSTROPHE_CHAR_0= RULE_APOSTROPHE_CHAR this_Graphical_1= ruleGraphical this_APOSTROPHE_CHAR_2= RULE_APOSTROPHE_CHAR this_Rehide_3= ruleRehide )
            // InternalBug292245TestLanguage.g:242:3: this_APOSTROPHE_CHAR_0= RULE_APOSTROPHE_CHAR this_Graphical_1= ruleGraphical this_APOSTROPHE_CHAR_2= RULE_APOSTROPHE_CHAR this_Rehide_3= ruleRehide
            {
                this_APOSTROPHE_CHAR_0 = (Token) match(input, RULE_APOSTROPHE_CHAR, FollowSets000.FOLLOW_5);
                current.merge(this_APOSTROPHE_CHAR_0);
                newLeafNode(this_APOSTROPHE_CHAR_0, grammarAccess.getFixAccess().getAPOSTROPHE_CHARTerminalRuleCall_0());
                newCompositeNode(grammarAccess.getFixAccess().getGraphicalParserRuleCall_1());
                pushFollow(FollowSets000.FOLLOW_3);
                this_Graphical_1 = ruleGraphical();
                state._fsp--;
                current.merge(this_Graphical_1);
                afterParserOrEnumRuleCall();
                this_APOSTROPHE_CHAR_2 = (Token) match(input, RULE_APOSTROPHE_CHAR, FollowSets000.FOLLOW_6);
                current.merge(this_APOSTROPHE_CHAR_2);
                newLeafNode(this_APOSTROPHE_CHAR_2, grammarAccess.getFixAccess().getAPOSTROPHE_CHARTerminalRuleCall_2());
                newCompositeNode(grammarAccess.getFixAccess().getRehideParserRuleCall_3());
                pushFollow(FollowSets000.FOLLOW_2);
                this_Rehide_3 = ruleRehide();
                state._fsp--;
                current.merge(this_Rehide_3);
                afterParserOrEnumRuleCall();
            }
        }
        leaveRule();
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        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 33 with XtextTokenStream

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

the class InternalBug297105TestLanguageParser method entryRuleReal.

// $ANTLR end "ruleRealValue"
// $ANTLR start "entryRuleReal"
// InternalBug297105TestLanguage.g:332:1: entryRuleReal returns [String current=null] : iv_ruleReal= ruleReal EOF ;
public final String entryRuleReal() throws RecognitionException {
    String current = null;
    AntlrDatatypeRuleToken iv_ruleReal = null;
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens();
    try {
        // InternalBug297105TestLanguage.g:334:2: (iv_ruleReal= ruleReal EOF )
        // InternalBug297105TestLanguage.g:335:2: iv_ruleReal= ruleReal EOF
        {
            if (state.backtracking == 0) {
                newCompositeNode(grammarAccess.getRealRule());
            }
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleReal = ruleReal();
            state._fsp--;
            if (state.failed)
                return current;
            if (state.backtracking == 0) {
                current = iv_ruleReal.getText();
            }
            match(input, EOF, FollowSets000.FOLLOW_2);
            if (state.failed)
                return current;
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        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 34 with XtextTokenStream

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

the class InternalBug297105TestLanguageParser method ruleReal.

// $ANTLR end "entryRuleReal"
// $ANTLR start "ruleReal"
// InternalBug297105TestLanguage.g:344:1: ruleReal returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : ( (this_INT_0= RULE_INT )? kw= '.' (this_EXT_INT_2= RULE_EXT_INT | this_INT_3= RULE_INT ) ) ;
public final AntlrDatatypeRuleToken ruleReal() throws RecognitionException {
    AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
    Token this_INT_0 = null;
    Token kw = null;
    Token this_EXT_INT_2 = null;
    Token this_INT_3 = null;
    enterRule();
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens();
    try {
        // InternalBug297105TestLanguage.g:351:2: ( ( (this_INT_0= RULE_INT )? kw= '.' (this_EXT_INT_2= RULE_EXT_INT | this_INT_3= RULE_INT ) ) )
        // InternalBug297105TestLanguage.g:352:2: ( (this_INT_0= RULE_INT )? kw= '.' (this_EXT_INT_2= RULE_EXT_INT | this_INT_3= RULE_INT ) )
        {
            // InternalBug297105TestLanguage.g:352:2: ( (this_INT_0= RULE_INT )? kw= '.' (this_EXT_INT_2= RULE_EXT_INT | this_INT_3= RULE_INT ) )
            // InternalBug297105TestLanguage.g:353:3: (this_INT_0= RULE_INT )? kw= '.' (this_EXT_INT_2= RULE_EXT_INT | this_INT_3= RULE_INT )
            {
                // InternalBug297105TestLanguage.g:353:3: (this_INT_0= RULE_INT )?
                int alt3 = 2;
                int LA3_0 = input.LA(1);
                if ((LA3_0 == RULE_INT)) {
                    alt3 = 1;
                }
                switch(alt3) {
                    case 1:
                        // InternalBug297105TestLanguage.g:354:4: this_INT_0= RULE_INT
                        {
                            this_INT_0 = (Token) match(input, RULE_INT, FollowSets000.FOLLOW_6);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                current.merge(this_INT_0);
                            }
                            if (state.backtracking == 0) {
                                newLeafNode(this_INT_0, grammarAccess.getRealAccess().getINTTerminalRuleCall_0());
                            }
                        }
                        break;
                }
                kw = (Token) match(input, 13, FollowSets000.FOLLOW_7);
                if (state.failed)
                    return current;
                if (state.backtracking == 0) {
                    current.merge(kw);
                    newLeafNode(kw, grammarAccess.getRealAccess().getFullStopKeyword_1());
                }
                // InternalBug297105TestLanguage.g:367:3: (this_EXT_INT_2= RULE_EXT_INT | this_INT_3= RULE_INT )
                int alt4 = 2;
                int LA4_0 = input.LA(1);
                if ((LA4_0 == RULE_EXT_INT)) {
                    alt4 = 1;
                } else if ((LA4_0 == RULE_INT)) {
                    alt4 = 2;
                } else {
                    if (state.backtracking > 0) {
                        state.failed = true;
                        return current;
                    }
                    NoViableAltException nvae = new NoViableAltException("", 4, 0, input);
                    throw nvae;
                }
                switch(alt4) {
                    case 1:
                        // InternalBug297105TestLanguage.g:368:4: this_EXT_INT_2= RULE_EXT_INT
                        {
                            this_EXT_INT_2 = (Token) match(input, RULE_EXT_INT, FollowSets000.FOLLOW_2);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                current.merge(this_EXT_INT_2);
                            }
                            if (state.backtracking == 0) {
                                newLeafNode(this_EXT_INT_2, grammarAccess.getRealAccess().getEXT_INTTerminalRuleCall_2_0());
                            }
                        }
                        break;
                    case 2:
                        // InternalBug297105TestLanguage.g:376:4: this_INT_3= RULE_INT
                        {
                            this_INT_3 = (Token) match(input, RULE_INT, FollowSets000.FOLLOW_2);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                current.merge(this_INT_3);
                            }
                            if (state.backtracking == 0) {
                                newLeafNode(this_INT_3, grammarAccess.getRealAccess().getINTTerminalRuleCall_2_1());
                            }
                        }
                        break;
                }
            }
        }
        if (state.backtracking == 0) {
            leaveRule();
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        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 35 with XtextTokenStream

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

the class InternalBug317840TestLanguageParser method entryRuleNAME.

// $ANTLR end "ruleNamed"
// $ANTLR start "entryRuleNAME"
// InternalBug317840TestLanguage.g:237:1: entryRuleNAME returns [String current=null] : iv_ruleNAME= ruleNAME EOF ;
public final String entryRuleNAME() throws RecognitionException {
    String current = null;
    AntlrDatatypeRuleToken iv_ruleNAME = null;
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens();
    try {
        // InternalBug317840TestLanguage.g:239:2: (iv_ruleNAME= ruleNAME EOF )
        // InternalBug317840TestLanguage.g:240:2: iv_ruleNAME= ruleNAME EOF
        {
            newCompositeNode(grammarAccess.getNAMERule());
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleNAME = ruleNAME();
            state._fsp--;
            current = iv_ruleNAME.getText();
            match(input, EOF, FollowSets000.FOLLOW_2);
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        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