Module Analysis.Files

This module contains operations to load and store analysis information persistently in files.

Author: Heiko Hoffmann, Michael Hanus

Version: March 2017

Summary of exported operations:

getAnalysisBaseFile :: String -> String -> IO String   
Get the file name in which analysis results are stored (without suffix ".pub" or ".priv")
getAnalysisPublicFile :: String -> String -> IO String   
Get the file name in which public analysis results are stored.
getAnalysisDirectory :: IO String   
getInterfaceInfos :: String -> [String] -> IO (ProgInfo a)   
loadDefaultAnalysisValues :: String -> String -> IO [((String,String),a)]   
Gets the file name in which default analysis values different from standard start values are stored.
loadCompleteAnalysis :: String -> String -> IO (ProgInfo a)   
Loads the currently stored analysis information for a module.
loadPublicAnalysis :: String -> String -> IO (ProgInfo a)   
Reads analysis result from file for the public entities of a given module.
storeImportModuleList :: String -> [String] -> IO ()   
Store current import dependencies.
getImportModuleListFile :: String -> IO (Maybe String)   
Gets the file containing import dependencies for a main module (if it exists).
storeAnalysisResult :: String -> String -> ProgInfo a -> IO ()   
Store an analysis results in a file and create directories if neccesssary.
createDirectoryR :: String -> IO ()   
deleteAllAnalysisFiles :: String -> IO ()   
Deletes all analysis files for a given analysis name.
findModuleSourceInLoadPath :: String -> IO (String,String)   
Returns a directory name and the actual source file name for a module by looking up the module source in the current load path.
getImports :: String -> IO [String]   
Get the imports of a module.
getSourceFileTime :: String -> IO (String,ClockTime)   
getFlatCurryFileTime :: String -> IO (String,Maybe ClockTime)   
flatCurryFileNewer :: String -> IO (Maybe String)   
Returns name of the FlatCurry file of a module if this file exists and is newer than the source file.
readNewestFlatCurry :: String -> IO Prog   
Returns the newest FlatCurry program for a module.
readNewestFlatCurryInt :: String -> IO Prog   
Returns the newest FlatCurry interface for a module.
flat2intName :: String -> String   
Translates FlatCurry file name to corresponding FlatCurry interface file name.

Exported operations:

getAnalysisBaseFile :: String -> String -> IO String   

Get the file name in which analysis results are stored (without suffix ".pub" or ".priv")

getAnalysisPublicFile :: String -> String -> IO String   

Get the file name in which public analysis results are stored.

getAnalysisDirectory :: IO String   

getInterfaceInfos :: String -> [String] -> IO (ProgInfo a)   

loadDefaultAnalysisValues :: String -> String -> IO [((String,String),a)]   

Gets the file name in which default analysis values different from standard start values are stored. Typically, such a file contains specific analysis information for external operations. The file must contain a term of the type [(String,a)] where the first component of each pair is the name of the operation (it is assumed that this denotes an operation of the current module) and the second component is an analysis value.

loadCompleteAnalysis :: String -> String -> IO (ProgInfo a)   

Loads the currently stored analysis information for a module.

loadPublicAnalysis :: String -> String -> IO (ProgInfo a)   

Reads analysis result from file for the public entities of a given module.

storeImportModuleList :: String -> [String] -> IO ()   

Store current import dependencies.

getImportModuleListFile :: String -> IO (Maybe String)   

Gets the file containing import dependencies for a main module (if it exists).

storeAnalysisResult :: String -> String -> ProgInfo a -> IO ()   

Store an analysis results in a file and create directories if neccesssary. The first argument is the analysis name.

createDirectoryR :: String -> IO ()   

deleteAllAnalysisFiles :: String -> IO ()   

Deletes all analysis files for a given analysis name.

findModuleSourceInLoadPath :: String -> IO (String,String)   

Returns a directory name and the actual source file name for a module by looking up the module source in the current load path. If the module is hierarchical, the directory is the top directory of the hierarchy. An error is raised if there is no corresponding source file.

getImports :: String -> IO [String]   

Get the imports of a module.

getSourceFileTime :: String -> IO (String,ClockTime)   

getFlatCurryFileTime :: String -> IO (String,Maybe ClockTime)   

flatCurryFileNewer :: String -> IO (Maybe String)   

Returns name of the FlatCurry file of a module if this file exists and is newer than the source file.

readNewestFlatCurry :: String -> IO Prog   

Returns the newest FlatCurry program for a module. The source program is parsed if the interface older than the source, otherwise the FlatCurry program is read without parsing (note that this returns only the correct version if the imported modules are already parsed or are not relevant here).

readNewestFlatCurryInt :: String -> IO Prog   

Returns the newest FlatCurry interface for a module. The source program is parsed if the interface older than the source, otherwise the FlatCurry interface file is read without parsing (note that this returns only the correct version if the imported modules are already parsed or are not relevant here).

flat2intName :: String -> String   

Translates FlatCurry file name to corresponding FlatCurry interface file name.