org.eclipse.xtext.parser.antlr.XtextTokenStream Java Examples
The following examples show how to use
org.eclipse.xtext.parser.antlr.XtextTokenStream.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: InternalSingleCodetemplateParser.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
public final void entryRuleLiteral() throws RecognitionException { HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); try { // InternalSingleCodetemplateParser.g:359:1: ( ruleLiteral EOF ) // InternalSingleCodetemplateParser.g:360:1: ruleLiteral EOF { before(grammarAccess.getLiteralRule()); pushFollow(FOLLOW_1); ruleLiteral(); state._fsp--; after(grammarAccess.getLiteralRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { myHiddenTokenState.restore(); } return ; }
Example #2
Source File: InternalBug377311TestLanguageParser.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
public final void entryRuleChild() throws RecognitionException { HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens("RULE_WS", "RULE_ID"); try { // InternalBug377311TestLanguage.g:82:1: ( ruleChild EOF ) // InternalBug377311TestLanguage.g:83:1: ruleChild EOF { before(grammarAccess.getChildRule()); pushFollow(FollowSets000.FOLLOW_1); ruleChild(); state._fsp--; after(grammarAccess.getChildRule()); match(input,EOF,FollowSets000.FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { myHiddenTokenState.restore(); } return ; }
Example #3
Source File: LexingTest.java From xtext-xtend with Eclipse Public License 2.0 | 5 votes |
protected void assertLexing(String input, Pair<String,String>... expectedTokens) { Lexer lexer = new InternalXtendLexer(null); CharStream stream = new ANTLRStringStream(input); lexer.setCharStream(stream); XtextTokenStream tokenStream = new XtextTokenStream(lexer, tokenDefProvider); List<?> tokens = tokenStream.getTokens(); assertEquals(input + " / " + tokens, expectedTokens.length, tokens.size()); for(int i = 0;i < tokens.size(); i++) { Token token = (Token) tokens.get(i); assertEquals(token.toString(), expectedTokens[i].getFirst(), token.getText()); final String expected = expectedTokens[i].getSecond(); String actual = tokenDefProvider.getTokenDefMap().get(token.getType()); assertEquals("expected "+expected+" but was "+actual, expected, actual); } }
Example #4
Source File: FowlerDslTestLanguageParser.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); }
Example #5
Source File: FormatterTestLanguageParser.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override protected InternalFormatterTestLanguageParser createParser(XtextTokenStream stream) { return new InternalFormatterTestLanguageParser(stream, getGrammarAccess()); }
Example #6
Source File: EcoreFragmentTestLanguageParser.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); }
Example #7
Source File: DomainModelTestLanguageParser.java From xtext-eclipse with Eclipse Public License 2.0 | 4 votes |
@Override protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); }
Example #8
Source File: OptionalEmptyTestLanguageParser.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); }
Example #9
Source File: MetamodelRefTestLanguageParser.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override protected InternalMetamodelRefTestLanguageParser createParser(XtextTokenStream stream) { return new InternalMetamodelRefTestLanguageParser(stream, getGrammarAccess()); }
Example #10
Source File: Bug289515TestLanguageParser.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); }
Example #11
Source File: ActionTestLanguage3Parser.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override protected InternalActionTestLanguage3Parser createParser(XtextTokenStream stream) { return new InternalActionTestLanguage3Parser(stream, getGrammarAccess()); }
Example #12
Source File: ImportUriUiTestLanguageParser.java From xtext-eclipse with Eclipse Public License 2.0 | 4 votes |
@Override protected InternalImportUriUiTestLanguageParser createParser(XtextTokenStream stream) { return new InternalImportUriUiTestLanguageParser(stream, getGrammarAccess()); }
Example #13
Source File: Bug297105TestLanguageParser.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); }
Example #14
Source File: InternalSingleCodetemplateParser.java From xtext-eclipse with Eclipse Public License 2.0 | 4 votes |
public final void ruleLiteralValue() throws RecognitionException { HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); int stackSize = keepStackSize(); try { // InternalSingleCodetemplateParser.g:170:2: ( ( ( ( rule__LiteralValue__Alternatives ) ) ( ( rule__LiteralValue__Alternatives )* ) ) ) // InternalSingleCodetemplateParser.g:171:2: ( ( ( rule__LiteralValue__Alternatives ) ) ( ( rule__LiteralValue__Alternatives )* ) ) { // InternalSingleCodetemplateParser.g:171:2: ( ( ( rule__LiteralValue__Alternatives ) ) ( ( rule__LiteralValue__Alternatives )* ) ) // InternalSingleCodetemplateParser.g:172:3: ( ( rule__LiteralValue__Alternatives ) ) ( ( rule__LiteralValue__Alternatives )* ) { // InternalSingleCodetemplateParser.g:172:3: ( ( rule__LiteralValue__Alternatives ) ) // InternalSingleCodetemplateParser.g:173:4: ( rule__LiteralValue__Alternatives ) { before(grammarAccess.getLiteralValueAccess().getAlternatives()); // InternalSingleCodetemplateParser.g:174:4: ( rule__LiteralValue__Alternatives ) // InternalSingleCodetemplateParser.g:174:5: rule__LiteralValue__Alternatives { pushFollow(FOLLOW_3); rule__LiteralValue__Alternatives(); state._fsp--; } after(grammarAccess.getLiteralValueAccess().getAlternatives()); } // InternalSingleCodetemplateParser.g:177:3: ( ( rule__LiteralValue__Alternatives )* ) // InternalSingleCodetemplateParser.g:178:4: ( rule__LiteralValue__Alternatives )* { before(grammarAccess.getLiteralValueAccess().getAlternatives()); // InternalSingleCodetemplateParser.g:179:4: ( rule__LiteralValue__Alternatives )* loop1: do { int alt1=2; int LA1_0 = input.LA(1); if ( (LA1_0==RULE_ID||(LA1_0>=RULE_WS && LA1_0<=RULE_ANY_OTHER)) ) { alt1=1; } switch (alt1) { case 1 : // InternalSingleCodetemplateParser.g:179:5: rule__LiteralValue__Alternatives { pushFollow(FOLLOW_3); rule__LiteralValue__Alternatives(); state._fsp--; } break; default : break loop1; } } while (true); after(grammarAccess.getLiteralValueAccess().getAlternatives()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); myHiddenTokenState.restore(); } return ; }
Example #15
Source File: ConditionModelParser.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
@Override protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { tokenStream.setInitialHiddenTokens("RULE_WS"); }
Example #16
Source File: Bug287941TestLanguageParser.java From xtext-eclipse with Eclipse Public License 2.0 | 4 votes |
@Override protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); }
Example #17
Source File: HiddenTerminalsTestLanguageParser.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override protected InternalHiddenTerminalsTestLanguageParser createParser(XtextTokenStream stream) { return new InternalHiddenTerminalsTestLanguageParser(stream, getGrammarAccess()); }
Example #18
Source File: CrossReferenceProposalTestLanguageParser.java From xtext-eclipse with Eclipse Public License 2.0 | 4 votes |
@Override protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); }
Example #19
Source File: UnorderedGroupsTestLanguageParser.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); }
Example #20
Source File: RefactoringTestLanguageParser.java From xtext-eclipse with Eclipse Public License 2.0 | 4 votes |
@Override protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); }
Example #21
Source File: Bug381381TestLanguageParser.java From xtext-eclipse with Eclipse Public License 2.0 | 4 votes |
@Override protected InternalBug381381TestLanguageParser createParser(XtextTokenStream stream) { return new InternalBug381381TestLanguageParser(stream, getGrammarAccess()); }
Example #22
Source File: ExBacktrackingBug325745TestLanguageParser.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); }
Example #23
Source File: CheckCfgParser.java From dsl-devkit with Eclipse Public License 1.0 | 4 votes |
@Override protected com.avaloq.tools.ddk.checkcfg.parser.antlr.internal.InternalCheckCfgParser createParser(XtextTokenStream stream) { return new com.avaloq.tools.ddk.checkcfg.parser.antlr.internal.InternalCheckCfgParser(stream, getGrammarAccess()); }
Example #24
Source File: BacktrackingContentAssistTestLanguageParser.java From xtext-eclipse with Eclipse Public License 2.0 | 4 votes |
@Override protected InternalBacktrackingContentAssistTestLanguageParser createParser(XtextTokenStream stream) { return new InternalBacktrackingContentAssistTestLanguageParser(stream, getGrammarAccess()); }
Example #25
Source File: Bug419429Parser.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override protected InternalBug419429Parser createParser(XtextTokenStream stream) { return new InternalBug419429Parser(stream, getGrammarAccess()); }
Example #26
Source File: Bug305397Parser.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override protected InternalBug305397Parser createParser(XtextTokenStream stream) { return new InternalBug305397Parser(stream, getGrammarAccess()); }
Example #27
Source File: EnumAndReferenceTestLanguageParser.java From xtext-extras with Eclipse Public License 2.0 | 4 votes |
@Override protected InternalEnumAndReferenceTestLanguageParser createParser(XtextTokenStream stream) { return new InternalEnumAndReferenceTestLanguageParser(stream, getGrammarAccess()); }
Example #28
Source File: DatatypeRulesTestLanguageParser.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); }
Example #29
Source File: XtextGrammarTestLanguageParser.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override protected InternalXtextGrammarTestLanguageParser createParser(XtextTokenStream stream) { return new InternalXtextGrammarTestLanguageParser(stream, getGrammarAccess()); }
Example #30
Source File: AbstractIgnoreCaseLinkingTestLanguageParser.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override protected InternalAbstractIgnoreCaseLinkingTestLanguageParser createParser(XtextTokenStream stream) { return new InternalAbstractIgnoreCaseLinkingTestLanguageParser(stream, getGrammarAccess()); }