Search in sources :

Example 31 with HiddenTokens

use of org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens 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 32 with HiddenTokens

use of org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens 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 33 with HiddenTokens

use of org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens 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)

Example 34 with HiddenTokens

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

the class InternalHiddenTerminalsTestLanguageParser method ruleOverridingHiddensCall.

// $ANTLR end "entryRuleOverridingHiddensCall"
// $ANTLR start "ruleOverridingHiddensCall"
// InternalHiddenTerminalsTestLanguage.g:343:1: ruleOverridingHiddensCall returns [EObject current=null] : (otherlv_0= 'call' ( (lv_spaces_1_0= RULE_WS ) )? ( (lv_valid_2_0= ';' ) ) ) ;
public final EObject ruleOverridingHiddensCall() throws RecognitionException {
    EObject current = null;
    Token otherlv_0 = null;
    Token lv_spaces_1_0 = null;
    Token lv_valid_2_0 = null;
    enterRule();
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens();
    try {
        // InternalHiddenTerminalsTestLanguage.g:350:2: ( (otherlv_0= 'call' ( (lv_spaces_1_0= RULE_WS ) )? ( (lv_valid_2_0= ';' ) ) ) )
        // InternalHiddenTerminalsTestLanguage.g:351:2: (otherlv_0= 'call' ( (lv_spaces_1_0= RULE_WS ) )? ( (lv_valid_2_0= ';' ) ) )
        {
            // InternalHiddenTerminalsTestLanguage.g:351:2: (otherlv_0= 'call' ( (lv_spaces_1_0= RULE_WS ) )? ( (lv_valid_2_0= ';' ) ) )
            // InternalHiddenTerminalsTestLanguage.g:352:3: otherlv_0= 'call' ( (lv_spaces_1_0= RULE_WS ) )? ( (lv_valid_2_0= ';' ) )
            {
                otherlv_0 = (Token) match(input, 15, FollowSets000.FOLLOW_5);
                newLeafNode(otherlv_0, grammarAccess.getOverridingHiddensCallAccess().getCallKeyword_0());
                // InternalHiddenTerminalsTestLanguage.g:356:3: ( (lv_spaces_1_0= RULE_WS ) )?
                int alt3 = 2;
                int LA3_0 = input.LA(1);
                if ((LA3_0 == RULE_WS)) {
                    alt3 = 1;
                }
                switch(alt3) {
                    case 1:
                        // InternalHiddenTerminalsTestLanguage.g:357:4: (lv_spaces_1_0= RULE_WS )
                        {
                            // InternalHiddenTerminalsTestLanguage.g:357:4: (lv_spaces_1_0= RULE_WS )
                            // InternalHiddenTerminalsTestLanguage.g:358:5: lv_spaces_1_0= RULE_WS
                            {
                                lv_spaces_1_0 = (Token) match(input, RULE_WS, FollowSets000.FOLLOW_6);
                                newLeafNode(lv_spaces_1_0, grammarAccess.getOverridingHiddensCallAccess().getSpacesWSTerminalRuleCall_1_0());
                                if (current == null) {
                                    current = createModelElement(grammarAccess.getOverridingHiddensCallRule());
                                }
                                addWithLastConsumed(current, "spaces", lv_spaces_1_0, "org.eclipse.xtext.parser.terminalrules.HiddenTerminalsTestLanguage.WS");
                            }
                        }
                        break;
                }
                // InternalHiddenTerminalsTestLanguage.g:374:3: ( (lv_valid_2_0= ';' ) )
                // InternalHiddenTerminalsTestLanguage.g:375:4: (lv_valid_2_0= ';' )
                {
                    // InternalHiddenTerminalsTestLanguage.g:375:4: (lv_valid_2_0= ';' )
                    // InternalHiddenTerminalsTestLanguage.g:376:5: lv_valid_2_0= ';'
                    {
                        lv_valid_2_0 = (Token) match(input, 10, FollowSets000.FOLLOW_2);
                        newLeafNode(lv_valid_2_0, grammarAccess.getOverridingHiddensCallAccess().getValidSemicolonKeyword_2_0());
                        if (current == null) {
                            current = createModelElement(grammarAccess.getOverridingHiddensCallRule());
                        }
                        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)

Example 35 with HiddenTokens

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

the class InternalHiddenTerminalsTestLanguageParser method entryRuleHidingHiddens.

// $ANTLR end "ruleDatatypeRule"
// $ANTLR start "entryRuleHidingHiddens"
// InternalHiddenTerminalsTestLanguage.g:574:1: entryRuleHidingHiddens returns [EObject current=null] : iv_ruleHidingHiddens= ruleHidingHiddens EOF ;
public final EObject entryRuleHidingHiddens() throws RecognitionException {
    EObject current = null;
    EObject iv_ruleHidingHiddens = null;
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens();
    try {
        // InternalHiddenTerminalsTestLanguage.g:576:2: (iv_ruleHidingHiddens= ruleHidingHiddens EOF )
        // InternalHiddenTerminalsTestLanguage.g:577:2: iv_ruleHidingHiddens= ruleHidingHiddens EOF
        {
            newCompositeNode(grammarAccess.getHidingHiddensRule());
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleHidingHiddens = ruleHidingHiddens();
            state._fsp--;
            current = iv_ruleHidingHiddens;
            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)

Aggregations

XtextTokenStream (org.eclipse.xtext.parser.antlr.XtextTokenStream)42 HiddenTokens (org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens)42 AntlrDatatypeRuleToken (org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)34 EObject (org.eclipse.emf.ecore.EObject)16