<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(self, filepath, dependencies=False, recursive=False, greedy=False):
 """Parses the fortran code in the specified file. :arg dependencies: if true, all folder paths will be searched for modules that have been referenced but aren't loaded in the parser. :arg greedy: if true, when a module cannot be found using a file name of module_name.f90, all modules in all folders are searched."""

        #If we have already parsed this file path, we should check to see if the
        #module file has changed and needs to be reparsed.
        abspath = self.tramp.abspath(filepath)
        self._add_current_codedir(abspath)
        fname = filepath.split("/")[-1].lower()
        mtime_check = self._check_parse_modtime(abspath, fname)

        if mtime_check is None:
            return

        #Keep track of parsing times if we are running in verbose mode.
        if self.verbose:
            start_time = clock()
            msg.okay("WORKING on {0}".format(abspath), 2)

        if fname not in self._modulefiles:
            self._modulefiles[fname] = []
        if fname not in self._programfiles:
            self._programfiles[fname] = []

        #Check if we can load the file from a pickle instead of doing a time
        #consuming file system parse.
        pickle_load = False
        pprograms = []
        if len(mtime_check) == 1 and settings.use_filesystem_cache:
            #We use the pickler to load the file since a cached version might
            #be good enough.
            pmodules = self.serialize.load_module(abspath, mtime_check[0], self)
            if pmodules is not None:
                for module in pmodules:
                    self.modules[module.name.lower()] = module
                    self._modulefiles[fname].append(module.name.lower())
                pickle_load = True
            else:
                #We have to do a full load from the file system.
                pmodules, pprograms = self._parse_from_file(abspath, fname,
                                                            dependencies, recursive, greedy)
        else:
            #We have to do a full load from the file system.
            pmodules, pprograms = self._parse_from_file(abspath, fname,
                                                        dependencies, recursive, greedy)

        #Add the filename to the list of files that have been parsed.
        self._parsed.append(abspath.lower())
        if not pickle_load and len(pmodules) > 0 and settings.use_filesystem_cache:
            self.serialize.save_module(abspath, pmodules)

        if self.verbose:
            msg.info("PARSED: {} modules and {} ".format(len(pmodules), len(pprograms)) + 
                     "programs in {} in {}".format(fname, secondsToStr(clock() - start_time)), 2)
            for module in pmodules:
                msg.gen("\tMODULE {}".format(module.name), 2)
            for program in pprograms:
                msg.gen("\tPROGRAM {}".format(program.name), 2)
            if len(pmodules) > 0 or len(pprograms) > 0:
                msg.blank()

        self._parse_dependencies(pmodules, dependencies, recursive, greedy)