Search in sources :

Example 1 with IAntlrTokenFileProvider

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

the class AbstractAntlrGeneratorFragment2 method createLexerTokensProvider.

protected MutableTokenDefProvider createLexerTokensProvider(final AntlrGrammar lexerGrammar, final KeywordHelper helper, final IXtextGeneratorFileSystemAccess fsa) {
    Charset _forName = Charset.forName(this.codeConfig.getEncoding());
    final MutableTokenDefProvider provider = new MutableTokenDefProvider(helper, _forName);
    final IAntlrTokenFileProvider _function = () -> {
        return fsa.readBinaryFile(lexerGrammar.getTokensFileName());
    };
    provider.setAntlrTokenFileProvider(_function);
    return provider;
}
Also used : Charset(java.nio.charset.Charset) MutableTokenDefProvider(org.eclipse.xtext.xtext.generator.parser.antlr.MutableTokenDefProvider) IAntlrTokenFileProvider(org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider)

Aggregations

Charset (java.nio.charset.Charset)1 IAntlrTokenFileProvider (org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider)1 MutableTokenDefProvider (org.eclipse.xtext.xtext.generator.parser.antlr.MutableTokenDefProvider)1