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