JavaFileObject fo = new StringJavaFileObject("Foo", text);
log.useSource(fo);
Scanner s = sfac.newScanner(fo.getCharContent(true));
Parser parser = pfac.newParser(s, false, genEndPos);
JCTree.JCCompilationUnit tree = parser.compilationUnit();
log.setEndPosTable(fo, tree.endPositions);
TreeScanner ts = new LogTester(log, tree.endPositions);
ts.scan(tree);