'Generates Python code for the entire routing tree.
The generated code is compiled and the resulting Python method
is returned.'

def _compile(self):

    src_lines = ['def    find(path,    return_values,    patterns,    converters,    params):', (_TAB_STR + 'path_len    =    len(path)')]
    self._return_values = []
    self._patterns = []
    self._converters = []
    self._ast = _CxParent()
    self._generate_ast(self._roots, self._ast, self._return_values, self._patterns)
    src_lines.append(self._ast.src(0))
    src_lines.append((_TAB_STR + 'return    None'))
    self._finder_src = '\n'.join(src_lines)
    scope = {}
    exec compile(self._finder_src, '<string>', 'exec') in scope
    return scope['find']
