def compile(self): reader = StreamReader(self._ctxt.getPspFileName(), self._ctxt) reader.init() writer = ServletWriter(self._ctxt) self._ctxt.setPSPReader(reader) self._ctxt.setServletWriter(writer) parser = PSPParser(self._ctxt) handler = ParseEventHandler(self._ctxt, parser) parser.setEventHandler(handler) handler.beginProcessing() parser.parse() handler.endProcessing() writer.close()
def compile(self): """Compile the PSP context and return a list of all source files.""" reader = StreamReader(self._ctxt.getPspFileName(), self._ctxt) reader.init() writer = ServletWriter(self._ctxt) self._ctxt.setPSPReader(reader) self._ctxt.setServletWriter(writer) parser = PSPParser(self._ctxt) handler = ParseEventHandler(self._ctxt, parser) parser.setEventHandler(handler) handler.beginProcessing() parser.parse() sourcefiles = set(reader.sourcefiles) handler.endProcessing() writer.close() return sourcefiles