'Compiles a pattern string to a nested pytree.*Pattern object.'

def compile_pattern(self, input, debug=False, with_tree=False):

    tokens = tokenize_wrapper(input)
    try:
        root = self.driver.parse_tokens(tokens, debug=debug)
    except parse.ParseError as e:
        raise PatternSyntaxError(str(e))
    if with_tree:
        return (self.compile_node(root), root)
    else:
        return self.compile_node(root)
