use of org.apache.groovy.antlr.GroovydocVisitor in project groovy by apache.
the class GroovyDocParser method parseGroovy.
private Map<String, GroovyClassDoc> parseGroovy(String packagePath, String file, String src) throws RuntimeException {
CompilerConfiguration config = new CompilerConfiguration();
config.getOptimizationOptions().put(CompilerConfiguration.GROOVYDOC, true);
CompilationUnit compUnit = new CompilationUnit(config);
SourceUnit unit = new SourceUnit(file, src, config, null, new ErrorCollector(config));
compUnit.addSource(unit);
compUnit.compile(Phases.CONVERSION);
ModuleNode root = unit.getAST();
GroovydocVisitor visitor = new GroovydocVisitor(unit, packagePath, links);
visitor.visitClass(root.getClasses().get(0));
return visitor.getGroovyClassDocs();
}
Aggregations