use of org.eclipse.xtext.parser.antlr.internal.InternalXtextLexer in project xtext-eclipse by eclipse.
the class XtextDocumentModifyTest method createDocument.
private IXtextDocument createDocument(String model) throws Exception {
resource = getResource(new StringInputStream(model));
DocumentTokenSource tokenSource = new DocumentTokenSource();
tokenSource.setLexer(new Provider<Lexer>() {
@Override
public Lexer get() {
return new InternalXtextLexer();
}
});
final XtextDocument document = new XtextDocument(tokenSource, get(ITextEditComposer.class), new OutdatedStateManager(), new OperationCanceledManager()) {
@Override
public <T> T internalModify(IUnitOfWork<T, XtextResource> work) {
try {
return work.exec((XtextResource) resource);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
};
document.set(model);
return document;
}
use of org.eclipse.xtext.parser.antlr.internal.InternalXtextLexer in project xtext-eclipse by eclipse.
the class DocumentLockerTest method createTokenSource.
private DocumentTokenSource createTokenSource() {
DocumentTokenSource tokenSource = new DocumentTokenSource();
tokenSource.setLexer(() -> new InternalXtextLexer());
return tokenSource;
}
use of org.eclipse.xtext.parser.antlr.internal.InternalXtextLexer in project xtext-eclipse by eclipse.
the class OutlineTreeProviderTest method createXtextDocument.
protected XtextDocument createXtextDocument(String modelAsText) throws Exception {
final XtextResource resource = getResource(modelAsText, "test.outlinetestlanguage");
DocumentTokenSource tokenSource = new DocumentTokenSource();
tokenSource.setLexer(new Provider<Lexer>() {
@Override
public Lexer get() {
return new InternalXtextLexer();
}
});
XtextDocument xtextDocument = new XtextDocument(tokenSource, null, new OutdatedStateManager(), new OperationCanceledManager());
xtextDocument.setInput(resource);
xtextDocument.set(modelAsText);
return xtextDocument;
}
Aggregations