class_docstr: Compiles a grammar. This will take the parse tree of a regular expression
  and compile the grammar.
  
  :param root_node: :class~`.regex_parser.Node` instance.
  :param escape_funcs: `dict` mapping variable names to escape callables.
  :param unescape_funcs: `dict` mapping variable names to unescape callables.
docstr: Do a partial match of the string with the grammar. The returned
  :class:`Match` instance can contain multiple representations of the
  match. This will never return `None`. If it doesn't match at all, the "trailing input"
  part will capture all of the input.
  
  :param string: The input string.
docstr_tok: ["Do","a","partial","match","of","the","string","with","the","grammar",".","The","returned",":","class",":","`","Match","`","instance","can","contain","multiple","representations","of","the","match",".","This","will","never","return","`","None","`",".","If","it","does","n't","match","at","all",",","the","``","trailing","input","''","part","will","capture","all","of","the","input",".",":","param","string",":","The","input","string","."]
code: def match_prefix(self, string):
      """
      Do a partial match of the string with the grammar. The returned
      :class:`Match` instance can contain multiple representations of the
      match. This will never return `None`. If it doesn't match at all, the "trailing input"
      part will capture all of the input.
  
      :param string: The input string.
      """
      # First try to match using `_re_prefix`. If nothing is found, use the patterns that
      # also accept trailing characters.
      for patterns in [
          self._re_prefix,
          self._re_prefix_with_trailing_input,
      ]:
          matches = [(r, r.match(string)) for r in patterns]
          matches = [(r, m) for r, m in matches if m]
  
          if matches != []:
              return Match(
                  string,
                  matches,
                  self._group_names_to_nodes,
                  self.unescape_funcs,
              )
  
imports: from __future__ import unicode_literals
  import re
  from six.moves import range
  from .regex_parser import Any, Sequence, Regex, Variable, Repeat, Lookahead
  from .regex_parser import parse_regex, tokenize_regex
label_desc: Use image node_id 7 for calling the _CompiledGrammar obj's underlying member method code with example usage: obj.match_prefix(string) and returns: Match