<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _parse_dependencies(self, pmodules, dependencies, recursive, greedy):
 """Parses the dependencies of the modules in the list pmodules. :arg pmodules: a list of modules that were parsed from a *.f90 file. :arg dependencies: when true, the dependency's dependencies will be loaded. :arg recursive: specifies whether to continue loading dependencies to completion; i.e. up the chain until we have every module that any module needs to run. :arg greedy: when true, """

        #See if we need to also load dependencies for the modules
        if dependencies:
            allkeys = [ module.name.lower() for module in pmodules ]
            for key in allkeys:
                for depend in self.modules[key].collection("dependencies"):
                    base = depend.split(".")[0]
                    if self.verbose and base.lower() not in self.modules:
                        msg.info("DEPENDENCY: {}".format(base), 2)
                    self.load_dependency(base, dependencies and recursive, recursive, greedy)