*/
private static Pair<SGLR, Pair<IStrategoTerm, Integer>> sglr(ParseTable table, final String source, final Path sourceFile, final String start, boolean useRecovery, final boolean parseMax, ITreeBuilder treeBuilder) throws SGLRException {
if (treeBuilder instanceof RetractableTreeBuilder && ((RetractableTreeBuilder) treeBuilder).isInitialized())
((RetractableTokenizer) treeBuilder.getTokenizer()).setKeywordRecognizer(table.getKeywordRecognizer());
final SGLR parser = new SGLR(treeBuilder, table);
parser.setUseStructureRecovery(useRecovery);
Callable<Pair<IStrategoTerm, Integer>> parseCallable = new Callable<Pair<IStrategoTerm, Integer>>() {
@Override
public Pair<IStrategoTerm, Integer> call() throws Exception {
Object o = parser.parseMax(source, sourceFile.getAbsolutePath(), start);
if (o instanceof IStrategoTerm)
return Pair.create((IStrategoTerm) o, source.length());
else {
Object[] os = (Object[]) o;
return Pair.create((IStrategoTerm) os[0], (Integer) os[1]);