Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
curry
curry-tools
Commits
d3258d9c
Commit
d3258d9c
authored
Aug 22, 2014
by
Michael Hanus
Browse files
CASS: public operation analyzePublic added
parent
390e207c
Changes
4
Hide whitespace changes
Inline
Side-by-side
CASS/AnalysisCollection.curry
View file @
d3258d9c
...
...
@@ -5,7 +5,7 @@
--- registered in the top part of this module.
---
--- @author Heiko Hoffmann, Michael Hanus
--- @version
May
201
3
--- @version
August
201
4
--------------------------------------------------------------------
module AnalysisCollection(
...
...
CASS/AnalysisServer.curry
View file @
d3258d9c
...
...
@@ -5,12 +5,13 @@
--- to use the analysis system in another Curry program.
---
--- @author Heiko Hoffmann, Michael Hanus
--- @version
May
201
3
--- @version
August
201
4
--------------------------------------------------------------------------
module AnalysisServer(main, initializeAnalysisSystem,
analyzeModuleForBrowser, analyzeFunctionForBrowser,
analyzeGeneric, analyzeInterface) where
analyzeGeneric, analyzePublic, analyzeInterface)
where
import ReadNumeric(readNat)
import Char(isSpace)
...
...
@@ -169,15 +170,25 @@ analyzeGeneric analysis moduleName = do
else
analyzeMain analysis moduleName [] True
--- Start the analysis system with a given analysis to compute properties
--- of a module interface.
--- The analysis must be a registered one if workers are used.
--- If it is a combined analysis, the base analysis must be also
--- a registered one.
analyzePublic :: Analysis a -> String -> IO (Either (ProgInfo a) String)
analyzePublic analysis moduleName =
analyzeGeneric analysis moduleName
>>= return . either (Left . publicProgInfo) Right
--- Start the analysis system with a given analysis to compute properties
--- of a module interface.
--- The analysis must be a registered one if workers are used.
--- If it is a combined analysis, the base analysis must be also
--- a registered one.
analyzeInterface :: Analysis a -> String -> IO (Either [(QName,a)] String)
analyzeInterface analysis moduleName =
do
analyzeInterface analysis moduleName =
analyzeGeneric analysis moduleName
>>= return . either (Left . publicListFromProgInfo) Right
>>= return . either (Left . publicListFromProgInfo) Right
--------------------------------------------------------------------------
-- start a number of workers at server start
...
...
CASS/GenericProgInfo.curry
View file @
d3258d9c
...
...
@@ -16,6 +16,7 @@ import XML
--- The first component are public declarations, the second the private ones.
data ProgInfo a = ProgInfo (FM QName a) (FM QName a)
--- The empty program information.
emptyProgInfo:: ProgInfo a
emptyProgInfo = ProgInfo (emptyFM (<)) (emptyFM (<))
...
...
@@ -39,6 +40,8 @@ lists2ProgInfo (xs,ys) = ProgInfo (listToFM (<) xs) (listToFM (<) ys)
publicListFromProgInfo:: ProgInfo a -> [(QName,a)]
publicListFromProgInfo (ProgInfo fm1 _) = fmToList fm1
--- Transforms a program information into a pair of lists
--- containing the information about public and private entities.
progInfo2Lists :: ProgInfo a -> ([(QName,a)],[(QName,a)])
progInfo2Lists (ProgInfo map1 map2)= (fmToList map1,fmToList map2)
...
...
@@ -56,6 +59,8 @@ mapProgInfo:: (a->b) -> ProgInfo a -> ProgInfo b
mapProgInfo func (ProgInfo map1 map2) =
ProgInfo (mapFM (\_ b->func b) map1) (mapFM (\_ b->func b) map2)
--- Transforms a program information into a program information
--- about interface entities only.
publicProgInfo :: ProgInfo a -> ProgInfo a
publicProgInfo (ProgInfo pub _) = ProgInfo pub (emptyFM (<))
...
...
analysis/RequiredValues.curry
View file @
d3258d9c
...
...
@@ -12,7 +12,7 @@
--- @version August 2014
-----------------------------------------------------------------------------
module RequiredValues(AType(..),showAType,AFType(..),showAFType,
module RequiredValues(AType(..),showAType,AFType(..),showAFType,
lubAType,
reqValueAnalysis)
where
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment