for (TreePath path : selection.getPaths()) {
roots.add(path.getFirstSegment());
}
Processor proc = new Processor(false);
ItemTypeFactory fact = new ItemTypeFactory(proc);
GetAstNodeFunction func = new GetAstNodeFunction(fact);
proc.registerExtensionFunction(func);
proc.registerExtensionFunction(new AstTextExtensionFunction(fact));
AnalysisPluginsManager.initialiseExtensions();
ExtensionFunctions extFuncs = new ExtensionFunctions(fact, proc);