Search in sources :

Example 26 with XtextTokenStream

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

the class InternalHiddenTerminalsTestLanguageParser method entryRuleOverridingHiddens.

// $ANTLR end "ruleWithHiddens"
// $ANTLR start "entryRuleOverridingHiddens"
// InternalHiddenTerminalsTestLanguage.g:254:1: entryRuleOverridingHiddens returns [EObject current=null] : iv_ruleOverridingHiddens= ruleOverridingHiddens EOF ;
public final EObject entryRuleOverridingHiddens() throws RecognitionException {
    EObject current = null;
    EObject iv_ruleOverridingHiddens = null;
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT");
    try {
        // InternalHiddenTerminalsTestLanguage.g:256:2: (iv_ruleOverridingHiddens= ruleOverridingHiddens EOF )
        // InternalHiddenTerminalsTestLanguage.g:257:2: iv_ruleOverridingHiddens= ruleOverridingHiddens EOF
        {
            newCompositeNode(grammarAccess.getOverridingHiddensRule());
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleOverridingHiddens = ruleOverridingHiddens();
            state._fsp--;
            current = iv_ruleOverridingHiddens;
            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 27 with XtextTokenStream

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

the class InternalHiddenTerminalsTestLanguageParser method ruleDatatypeRule.

// $ANTLR end "entryRuleDatatypeRule"
// $ANTLR start "ruleDatatypeRule"
// InternalHiddenTerminalsTestLanguage.g:548:1: ruleDatatypeRule returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (kw= 'rule' kw= ';' ) ;
public final AntlrDatatypeRuleToken ruleDatatypeRule() throws RecognitionException {
    AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
    Token kw = null;
    enterRule();
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens("RULE_WS");
    try {
        // InternalHiddenTerminalsTestLanguage.g:555:2: ( (kw= 'rule' kw= ';' ) )
        // InternalHiddenTerminalsTestLanguage.g:556:2: (kw= 'rule' kw= ';' )
        {
            // InternalHiddenTerminalsTestLanguage.g:556:2: (kw= 'rule' kw= ';' )
            // InternalHiddenTerminalsTestLanguage.g:557:3: kw= 'rule' kw= ';'
            {
                kw = (Token) match(input, 18, FollowSets000.FOLLOW_6);
                current.merge(kw);
                newLeafNode(kw, grammarAccess.getDatatypeRuleAccess().getRuleKeyword_0());
                kw = (Token) match(input, 10, FollowSets000.FOLLOW_2);
                current.merge(kw);
                newLeafNode(kw, grammarAccess.getDatatypeRuleAccess().getSemicolonKeyword_1());
            }
        }
        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 28 with XtextTokenStream

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

the class InternalBug292245TestLanguageParser method ruleRehide.

// $ANTLR end "entryRuleRehide"
// $ANTLR start "ruleRehide"
// InternalBug292245TestLanguage.g:328:1: ruleRehide returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (kw= '^' )? ;
public final AntlrDatatypeRuleToken ruleRehide() throws RecognitionException {
    AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
    Token kw = null;
    enterRule();
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens("RULE_WS");
    try {
        // InternalBug292245TestLanguage.g:335:2: ( (kw= '^' )? )
        // InternalBug292245TestLanguage.g:336:2: (kw= '^' )?
        {
            // InternalBug292245TestLanguage.g:336:2: (kw= '^' )?
            int alt5 = 2;
            int LA5_0 = input.LA(1);
            if ((LA5_0 == 10)) {
                alt5 = 1;
            }
            switch(alt5) {
                case 1:
                    // InternalBug292245TestLanguage.g:337:3: kw= '^'
                    {
                        kw = (Token) match(input, 10, FollowSets000.FOLLOW_2);
                        current.merge(kw);
                        newLeafNode(kw, grammarAccess.getRehideAccess().getCircumflexAccentKeyword());
                    }
                    break;
            }
        }
        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 29 with XtextTokenStream

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

the class InternalBug292245TestLanguageParser method entryRuleError.

// $ANTLR end "ruleModel"
// $ANTLR start "entryRuleError"
// InternalBug292245TestLanguage.g:169:1: entryRuleError returns [String current=null] : iv_ruleError= ruleError EOF ;
public final String entryRuleError() throws RecognitionException {
    String current = null;
    AntlrDatatypeRuleToken iv_ruleError = null;
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens();
    try {
        // InternalBug292245TestLanguage.g:171:2: (iv_ruleError= ruleError EOF )
        // InternalBug292245TestLanguage.g:172:2: iv_ruleError= ruleError EOF
        {
            newCompositeNode(grammarAccess.getErrorRule());
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleError = ruleError();
            state._fsp--;
            current = iv_ruleError.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 30 with XtextTokenStream

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

the class InternalBug292245TestLanguageParser method entryRuleApostrophe.

// $ANTLR end "ruleFix"
// $ANTLR start "entryRuleApostrophe"
// InternalBug292245TestLanguage.g:283:1: entryRuleApostrophe returns [String current=null] : iv_ruleApostrophe= ruleApostrophe EOF ;
public final String entryRuleApostrophe() throws RecognitionException {
    String current = null;
    AntlrDatatypeRuleToken iv_ruleApostrophe = null;
    HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens("RULE_WS");
    try {
        // InternalBug292245TestLanguage.g:285:2: (iv_ruleApostrophe= ruleApostrophe EOF )
        // InternalBug292245TestLanguage.g:286:2: iv_ruleApostrophe= ruleApostrophe EOF
        {
            newCompositeNode(grammarAccess.getApostropheRule());
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleApostrophe = ruleApostrophe();
            state._fsp--;
            current = iv_ruleApostrophe.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