Module Analysis.Files

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

Author: Heiko Hoffmann, Michael Hanus

Version: September 2023

Summary of exported operations:

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

Exported operations:

getAnalysisBaseFile :: String -> String -> IO String  Non-deterministic 

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

getAnalysisPublicFile :: String -> String -> IO String  Non-deterministic 

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

getAnalysisDirectory :: IO String  Deterministic 

getInterfaceInfos :: Read a => DLevel -> String -> [String] -> IO (ProgInfo a)  Non-deterministic 

loadDefaultAnalysisValues :: Read a => DLevel -> String -> String -> IO [((String,String),a)]  Non-deterministic 

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 :: Read a => DLevel -> String -> String -> IO (ProgInfo a)  Non-deterministic 

Loads the currently stored analysis information for a module.

loadPublicAnalysis :: Read a => DLevel -> String -> String -> IO (ProgInfo a)  Non-deterministic 

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

storeImportModuleList :: DLevel -> String -> [String] -> IO ()  Non-deterministic 

Store current import dependencies.

getImportModuleListFile :: String -> IO (Maybe String)  Non-deterministic 

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

storeAnalysisResult :: Show a => DLevel -> String -> String -> ProgInfo a -> IO ()  Non-deterministic 

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

createDirectoryR :: DLevel -> String -> IO ()  Deterministic 

deleteAllAnalysisFiles :: String -> IO ()  Deterministic 

Deletes all analysis files for a given analysis name.

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

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 :: DLevel -> String -> IO [String]  Non-deterministic 

Get the imports of a module.

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

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

flatCurryFileNewer :: String -> IO (Maybe String)  Non-deterministic 

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

readNewestFlatCurry :: String -> IO Prog  Non-deterministic 

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  Non-deterministic 

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  Deterministic 

Translates FlatCurry file name to corresponding FlatCurry interface file name.