private void write(PrintWriter writer, Janitor janitor, List messages, String txt) {
if (messages==null || messages.size()==0) return;
Iterator iterator = messages.iterator();
while (iterator.hasNext()) {
Message message = (Message) iterator.next();
message.write(writer, janitor);
if (configuration.getDebug() && (message instanceof SyntaxErrorMessage)){
SyntaxErrorMessage sem = (SyntaxErrorMessage) message;
sem.getCause().printStackTrace(writer);
}