definition:
|
runAnalysis :: (Eq a, Read a) => CConfig -> Analysis a -> Prog -> ProgInfo a
-> [(QName,a)] -> String -> IO (ProgInfo a)
runAnalysis cconfig analysis prog importInfos startvals fpmethod = do
deflts <- loadDefaultAnalysisValues dl (analysisName analysis) (progName prog)
let defaultFuncs =
updProgFuncs (filter (\fd -> funcName fd `elem` map fst deflts)) prog
definedFuncs =
updProgFuncs (filter (\fd -> funcName fd `notElem` map fst deflts)) prog
defaultTypes =
updProgTypes (filter (\fd -> typeName fd `elem` map fst deflts)) prog
definedTypes =
updProgTypes (filter (\fd -> typeName fd `notElem` map fst deflts)) prog
let (progWithoutDefaults,defaultproginfo) = case analysis of
SimpleFuncAnalysis _ _ ->
(definedFuncs, funcInfos2ProgInfo defaultFuncs deflts)
SimpleTypeAnalysis _ _ ->
(definedTypes, typeInfos2ProgInfo defaultTypes deflts)
SimpleConstructorAnalysis _ _ -> -- there are no external constructors
if Prelude.null deflts then (prog,emptyProgInfo)
else error "SimpleConstructorAnalysis with default values!"
DependencyFuncAnalysis _ _ _ ->
(definedFuncs, funcInfos2ProgInfo defaultFuncs deflts)
DependencyTypeAnalysis _ _ _ ->
(definedTypes, typeInfos2ProgInfo defaultTypes deflts)
SimpleModuleAnalysis _ _ ->
if Prelude.null deflts then (definedFuncs, emptyProgInfo)
else error defaultNotEmptyError
DependencyModuleAnalysis _ _ ->
if Prelude.null deflts then (definedFuncs, emptyProgInfo)
else error defaultNotEmptyError
_ -> error "Internal error in WorkerFunctions.runAnalysis"
let result = executeAnalysis analysis progWithoutDefaults
(combineProgInfo importInfos defaultproginfo)
startvals fpmethod
return $ combineProgInfo defaultproginfo result
where
dl = debugLevel cconfig
defaultNotEmptyError = "Default analysis information for analysis '" ++
analysisName analysis ++ "' and module '" ++
progName prog ++ "' not empty!"
|
iotype:
|
{(_,_,_,_,_,_,_,_) |-> _}
|
signature:
|
(Prelude.Eq a, Prelude.Read a) => CASS.Configuration.CConfig
-> Analysis.Types.Analysis a -> FlatCurry.Types.Prog
-> Analysis.ProgInfo.ProgInfo a -> [((String, String), a)] -> String
-> Prelude.IO (Analysis.ProgInfo.ProgInfo a)
|