ParserProcessor parser = new ParserProcessor();
parser.setLog(log);
parser.setParserAutomaton(parserautomaton);
// Create factory for SAX transformer
SAXTransformerFactory transformerFactoryImpl =
(SAXTransformerFactory)SAXTransformerFactory.newInstance();
// Create serializer to write the SAX stream into a file
TransformerHandler serializer = transformerFactoryImpl.newTransformerHandler();
serializer.setResult(new StreamResult(outFile));
// Connect components into a pipeline
lexer.setContentHandler(parser);
parser.setContentHandler(serializer);