in doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java [208:251]
public void parse(Reader source, Sink sink, String reference) throws ParseException {
init();
try {
StringWriter contentWriter = new StringWriter();
IOUtils.copy(source, contentWriter);
sourceContent = contentWriter.toString();
} catch (IOException e) {
throw new AptParseException(e);
}
try {
this.source = new AptReaderSource(new StringReader(sourceContent), reference);
this.sink = getWrappedSink(sink);
sink.setDocumentLocator(new AptSourceLocator(this.source, reference));
blockFileName = null;
blockLineNumber = -1;
// Lookahead line.
nextLine();
// Lookahead block.
nextBlock(/*first*/ true);
// traverse comments
while ((block != null) && (block.getType() == COMMENT_BLOCK)) {
block.traverse();
nextBlock(/*first*/ true);
}
traverseHead();
traverseBody();
} catch (AptParseException ape) {
// TODO handle column number
throw new AptParseException(null, ape, getSourceName(), getSourceLineNumber(), -1);
} finally {
setSecondParsing(false);
init();
}
}