Search in sources :

Example 1 with BacktrackingLexerDocumentTokenSource

use of org.eclipse.xtext.ui.editor.model.BacktrackingLexerDocumentTokenSource in project xtext-eclipse by eclipse.

the class BacktrackingLexerPresentationDamagerTest method createDocument.

@Override
protected Document createDocument(String before) throws Exception {
    DocumentTokenSource source = new BacktrackingLexerDocumentTokenSource();
    source.setLexer(new Provider<Lexer>() {

        @Override
        public Lexer get() {
            return createLexer();
        }
    });
    XtextDocument document = new XtextDocument(source, null, outdatedStateManager, operationCanceledManager);
    document.set(before);
    return document;
}
Also used : Lexer(org.eclipse.xtext.parser.antlr.Lexer) BacktrackingLexerDocumentTokenSource(org.eclipse.xtext.ui.editor.model.BacktrackingLexerDocumentTokenSource) DocumentTokenSource(org.eclipse.xtext.ui.editor.model.DocumentTokenSource) XtextDocument(org.eclipse.xtext.ui.editor.model.XtextDocument) BacktrackingLexerDocumentTokenSource(org.eclipse.xtext.ui.editor.model.BacktrackingLexerDocumentTokenSource)

Aggregations

Lexer (org.eclipse.xtext.parser.antlr.Lexer)1 BacktrackingLexerDocumentTokenSource (org.eclipse.xtext.ui.editor.model.BacktrackingLexerDocumentTokenSource)1 DocumentTokenSource (org.eclipse.xtext.ui.editor.model.DocumentTokenSource)1 XtextDocument (org.eclipse.xtext.ui.editor.model.XtextDocument)1