Search in sources :

Example 21 with XtextTokenStream

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

the class InternalFormatterTestLanguageParser method ruleSuppressedHidden.

// $ANTLR end "entryRuleSuppressedHidden"
// $ANTLR start "ruleSuppressedHidden"
// InternalFormatterTestLanguage.g:989:1: ruleSuppressedHidden returns [EObject current=null] : ( () otherlv_1= '`' ( ( (lv_vals_2_0= ruleSuppressedHiddenSub ) ) (otherlv_3= '%' ( (lv_vals_4_0= ruleSuppressedHiddenSub ) ) )* )? otherlv_5= '`' ) ;
public final EObject ruleSuppressedHidden() throws RecognitionException {
    EObject current = null;
    Token otherlv_1 = null;
    Token otherlv_3 = null;
    Token otherlv_5 = null;
    EObject lv_vals_2_0 = null;
    EObject lv_vals_4_0 = null;
    enterRule();
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens();
    try {
        // InternalFormatterTestLanguage.g:996:2: ( ( () otherlv_1= '`' ( ( (lv_vals_2_0= ruleSuppressedHiddenSub ) ) (otherlv_3= '%' ( (lv_vals_4_0= ruleSuppressedHiddenSub ) ) )* )? otherlv_5= '`' ) )
        // InternalFormatterTestLanguage.g:997:2: ( () otherlv_1= '`' ( ( (lv_vals_2_0= ruleSuppressedHiddenSub ) ) (otherlv_3= '%' ( (lv_vals_4_0= ruleSuppressedHiddenSub ) ) )* )? otherlv_5= '`' )
        {
            // InternalFormatterTestLanguage.g:997:2: ( () otherlv_1= '`' ( ( (lv_vals_2_0= ruleSuppressedHiddenSub ) ) (otherlv_3= '%' ( (lv_vals_4_0= ruleSuppressedHiddenSub ) ) )* )? otherlv_5= '`' )
            // InternalFormatterTestLanguage.g:998:3: () otherlv_1= '`' ( ( (lv_vals_2_0= ruleSuppressedHiddenSub ) ) (otherlv_3= '%' ( (lv_vals_4_0= ruleSuppressedHiddenSub ) ) )* )? otherlv_5= '`'
            {
                // InternalFormatterTestLanguage.g:998:3: ()
                // InternalFormatterTestLanguage.g:999:4:
                {
                    current = forceCreateModelElement(grammarAccess.getSuppressedHiddenAccess().getSuppressedHiddenAction_0(), current);
                }
                otherlv_1 = (Token) match(input, 33, FollowSets000.FOLLOW_24);
                newLeafNode(otherlv_1, grammarAccess.getSuppressedHiddenAccess().getGraveAccentKeyword_1());
                // InternalFormatterTestLanguage.g:1009:3: ( ( (lv_vals_2_0= ruleSuppressedHiddenSub ) ) (otherlv_3= '%' ( (lv_vals_4_0= ruleSuppressedHiddenSub ) ) )* )?
                int alt17 = 2;
                int LA17_0 = input.LA(1);
                if ((LA17_0 == RULE_ID || LA17_0 == 35)) {
                    alt17 = 1;
                }
                switch(alt17) {
                    case 1:
                        // InternalFormatterTestLanguage.g:1010:4: ( (lv_vals_2_0= ruleSuppressedHiddenSub ) ) (otherlv_3= '%' ( (lv_vals_4_0= ruleSuppressedHiddenSub ) ) )*
                        {
                            // InternalFormatterTestLanguage.g:1010:4: ( (lv_vals_2_0= ruleSuppressedHiddenSub ) )
                            // InternalFormatterTestLanguage.g:1011:5: (lv_vals_2_0= ruleSuppressedHiddenSub )
                            {
                                // InternalFormatterTestLanguage.g:1011:5: (lv_vals_2_0= ruleSuppressedHiddenSub )
                                // InternalFormatterTestLanguage.g:1012:6: lv_vals_2_0= ruleSuppressedHiddenSub
                                {
                                    newCompositeNode(grammarAccess.getSuppressedHiddenAccess().getValsSuppressedHiddenSubParserRuleCall_2_0_0());
                                    pushFollow(FollowSets000.FOLLOW_25);
                                    lv_vals_2_0 = ruleSuppressedHiddenSub();
                                    state._fsp--;
                                    if (current == null) {
                                        current = createModelElementForParent(grammarAccess.getSuppressedHiddenRule());
                                    }
                                    add(current, "vals", lv_vals_2_0, "org.eclipse.xtext.parsetree.formatter.FormatterTestLanguage.SuppressedHiddenSub");
                                    afterParserOrEnumRuleCall();
                                }
                            }
                            // InternalFormatterTestLanguage.g:1029:4: (otherlv_3= '%' ( (lv_vals_4_0= ruleSuppressedHiddenSub ) ) )*
                            loop16: do {
                                int alt16 = 2;
                                int LA16_0 = input.LA(1);
                                if ((LA16_0 == 34)) {
                                    alt16 = 1;
                                }
                                switch(alt16) {
                                    case 1:
                                        // InternalFormatterTestLanguage.g:1030:5: otherlv_3= '%' ( (lv_vals_4_0= ruleSuppressedHiddenSub ) )
                                        {
                                            otherlv_3 = (Token) match(input, 34, FollowSets000.FOLLOW_26);
                                            newLeafNode(otherlv_3, grammarAccess.getSuppressedHiddenAccess().getPercentSignKeyword_2_1_0());
                                            // InternalFormatterTestLanguage.g:1034:5: ( (lv_vals_4_0= ruleSuppressedHiddenSub ) )
                                            // InternalFormatterTestLanguage.g:1035:6: (lv_vals_4_0= ruleSuppressedHiddenSub )
                                            {
                                                // InternalFormatterTestLanguage.g:1035:6: (lv_vals_4_0= ruleSuppressedHiddenSub )
                                                // InternalFormatterTestLanguage.g:1036:7: lv_vals_4_0= ruleSuppressedHiddenSub
                                                {
                                                    newCompositeNode(grammarAccess.getSuppressedHiddenAccess().getValsSuppressedHiddenSubParserRuleCall_2_1_1_0());
                                                    pushFollow(FollowSets000.FOLLOW_25);
                                                    lv_vals_4_0 = ruleSuppressedHiddenSub();
                                                    state._fsp--;
                                                    if (current == null) {
                                                        current = createModelElementForParent(grammarAccess.getSuppressedHiddenRule());
                                                    }
                                                    add(current, "vals", lv_vals_4_0, "org.eclipse.xtext.parsetree.formatter.FormatterTestLanguage.SuppressedHiddenSub");
                                                    afterParserOrEnumRuleCall();
                                                }
                                            }
                                        }
                                        break;
                                    default:
                                        break loop16;
                                }
                            } while (true);
                        }
                        break;
                }
                otherlv_5 = (Token) match(input, 33, FollowSets000.FOLLOW_2);
                newLeafNode(otherlv_5, grammarAccess.getSuppressedHiddenAccess().getGraveAccentKeyword_3());
            }
        }
        leaveRule();
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        myHiddenTokenState.restore();
    }
    return current;
}
Also used : XtextTokenStream(org.eclipse.xtext.parser.antlr.XtextTokenStream) EObject(org.eclipse.emf.ecore.EObject) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken) HiddenTokens(org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens)

Example 22 with XtextTokenStream

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

the class InternalFormatterTestLanguageParser method entryRuleSuppressedHiddenSubSub.

// $ANTLR end "ruleSuppressedHiddenSub"
// $ANTLR start "entryRuleSuppressedHiddenSubSub"
// InternalFormatterTestLanguage.g:1102:1: entryRuleSuppressedHiddenSubSub returns [EObject current=null] : iv_ruleSuppressedHiddenSubSub= ruleSuppressedHiddenSubSub EOF ;
public final EObject entryRuleSuppressedHiddenSubSub() throws RecognitionException {
    EObject current = null;
    EObject iv_ruleSuppressedHiddenSubSub = null;
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens("RULE_WS");
    try {
        // InternalFormatterTestLanguage.g:1104:2: (iv_ruleSuppressedHiddenSubSub= ruleSuppressedHiddenSubSub EOF )
        // InternalFormatterTestLanguage.g:1105:2: iv_ruleSuppressedHiddenSubSub= ruleSuppressedHiddenSubSub EOF
        {
            newCompositeNode(grammarAccess.getSuppressedHiddenSubSubRule());
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleSuppressedHiddenSubSub = ruleSuppressedHiddenSubSub();
            state._fsp--;
            current = iv_ruleSuppressedHiddenSubSub;
            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) EObject(org.eclipse.emf.ecore.EObject) HiddenTokens(org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens)

Example 23 with XtextTokenStream

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

the class InternalHiddenTerminalsTestLanguageParser method entryRuleDatatypeRule.

// $ANTLR end "ruleDatatypeHiddens"
// $ANTLR start "entryRuleDatatypeRule"
// InternalHiddenTerminalsTestLanguage.g:536:1: entryRuleDatatypeRule returns [String current=null] : iv_ruleDatatypeRule= ruleDatatypeRule EOF ;
public final String entryRuleDatatypeRule() throws RecognitionException {
    String current = null;
    AntlrDatatypeRuleToken iv_ruleDatatypeRule = null;
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens("RULE_WS");
    try {
        // InternalHiddenTerminalsTestLanguage.g:538:2: (iv_ruleDatatypeRule= ruleDatatypeRule EOF )
        // InternalHiddenTerminalsTestLanguage.g:539:2: iv_ruleDatatypeRule= ruleDatatypeRule EOF
        {
            newCompositeNode(grammarAccess.getDatatypeRuleRule());
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleDatatypeRule = ruleDatatypeRule();
            state._fsp--;
            current = iv_ruleDatatypeRule.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 24 with XtextTokenStream

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

the class InternalHiddenTerminalsTestLanguageParser method entryRuleInheritingHiddens.

// $ANTLR end "ruleOverridingHiddensCall"
// $ANTLR start "entryRuleInheritingHiddens"
// InternalHiddenTerminalsTestLanguage.g:395:1: entryRuleInheritingHiddens returns [EObject current=null] : iv_ruleInheritingHiddens= ruleInheritingHiddens EOF ;
public final EObject entryRuleInheritingHiddens() throws RecognitionException {
    EObject current = null;
    EObject iv_ruleInheritingHiddens = null;
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT");
    try {
        // InternalHiddenTerminalsTestLanguage.g:397:2: (iv_ruleInheritingHiddens= ruleInheritingHiddens EOF )
        // InternalHiddenTerminalsTestLanguage.g:398:2: iv_ruleInheritingHiddens= ruleInheritingHiddens EOF
        {
            newCompositeNode(grammarAccess.getInheritingHiddensRule());
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleInheritingHiddens = ruleInheritingHiddens();
            state._fsp--;
            current = iv_ruleInheritingHiddens;
            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) EObject(org.eclipse.emf.ecore.EObject) HiddenTokens(org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens)

Example 25 with XtextTokenStream

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

the class InternalHiddenTerminalsTestLanguageParser method ruleWithHiddens.

// $ANTLR end "entryRuleWithHiddens"
// $ANTLR start "ruleWithHiddens"
// InternalHiddenTerminalsTestLanguage.g:216:1: ruleWithHiddens returns [EObject current=null] : (otherlv_0= 'with' otherlv_1= 'hiddens' ( (lv_valid_2_0= ';' ) ) ) ;
public final EObject ruleWithHiddens() throws RecognitionException {
    EObject current = null;
    Token otherlv_0 = null;
    Token otherlv_1 = null;
    Token lv_valid_2_0 = null;
    enterRule();
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT");
    try {
        // InternalHiddenTerminalsTestLanguage.g:223:2: ( (otherlv_0= 'with' otherlv_1= 'hiddens' ( (lv_valid_2_0= ';' ) ) ) )
        // InternalHiddenTerminalsTestLanguage.g:224:2: (otherlv_0= 'with' otherlv_1= 'hiddens' ( (lv_valid_2_0= ';' ) ) )
        {
            // InternalHiddenTerminalsTestLanguage.g:224:2: (otherlv_0= 'with' otherlv_1= 'hiddens' ( (lv_valid_2_0= ';' ) ) )
            // InternalHiddenTerminalsTestLanguage.g:225:3: otherlv_0= 'with' otherlv_1= 'hiddens' ( (lv_valid_2_0= ';' ) )
            {
                otherlv_0 = (Token) match(input, 11, FollowSets000.FOLLOW_4);
                newLeafNode(otherlv_0, grammarAccess.getWithHiddensAccess().getWithKeyword_0());
                otherlv_1 = (Token) match(input, 9, FollowSets000.FOLLOW_6);
                newLeafNode(otherlv_1, grammarAccess.getWithHiddensAccess().getHiddensKeyword_1());
                // InternalHiddenTerminalsTestLanguage.g:233:3: ( (lv_valid_2_0= ';' ) )
                // InternalHiddenTerminalsTestLanguage.g:234:4: (lv_valid_2_0= ';' )
                {
                    // InternalHiddenTerminalsTestLanguage.g:234:4: (lv_valid_2_0= ';' )
                    // InternalHiddenTerminalsTestLanguage.g:235:5: lv_valid_2_0= ';'
                    {
                        lv_valid_2_0 = (Token) match(input, 10, FollowSets000.FOLLOW_2);
                        newLeafNode(lv_valid_2_0, grammarAccess.getWithHiddensAccess().getValidSemicolonKeyword_2_0());
                        if (current == null) {
                            current = createModelElement(grammarAccess.getWithHiddensRule());
                        }
                        setWithLastConsumed(current, "valid", true, ";");
                    }
                }
            }
        }
        leaveRule();
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        myHiddenTokenState.restore();
    }
    return current;
}
Also used : XtextTokenStream(org.eclipse.xtext.parser.antlr.XtextTokenStream) EObject(org.eclipse.emf.ecore.EObject) 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