def METHOD_NAME(output_lines, source, class_node):
  function_type = (
      ast.FUNCTION_VIRTUAL | ast.FUNCTION_PURE_VIRTUAL | ast.FUNCTION_OVERRIDE)
  ctor_or_dtor = ast.FUNCTION_CTOR | ast.FUNCTION_DTOR
  indent = ' ' * _INDENT
  for node in class_node.body:
    # We only care about virtual functions.
    if (isinstance(node, ast.Function) and node.modifiers & function_type and
        not node.modifiers & ctor_or_dtor):
      # Pick out all the elements we need from the original function.
      modifiers = 'override'
      if node.modifiers & ast.FUNCTION_CONST:
        modifiers = 'const, ' + modifiers
      return_type = 'void'
      if node.return_type:
        return_type = _EscapeForMacro(_RenderType(node.return_type))
      args = []
      for p in node.parameters:
        arg = _GenerateArg(source[p.start:p.end])
        if arg != 'void':
          args.append(_EscapeForMacro(arg))
      # Create the mock method definition.
      output_lines.extend([
          '%sMOCK_METHOD(%s, %s, (%s), (%s));' %
          (indent, return_type, node.name, ', '.join(args), modifiers)
      ])