summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreiLapets <>2013-08-19 07:14:35 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2013-08-19 07:14:35 (GMT)
commit290b88d238f81ab7498e8c0badec326500b85749 (patch)
treecfc2873b13ea38cd01a4b8edf7f2442e9df14ba6
parent771aa8bbce33320221adccae427c3616e2027f01 (diff)
version 0.0.0.20.0.0.2
-rw-r--r--StaticAnalysis/All.hs11
-rw-r--r--StaticAnalysis/Analysis.hs18
-rw-r--r--StaticAnalysis/Analyze.hs35
-rw-r--r--StaticAnalysis/Annotate.hs (renamed from StaticAnalysis/Annotated.hs)14
-rw-r--r--staticanalysis.cabal5
5 files changed, 68 insertions, 15 deletions
diff --git a/StaticAnalysis/All.hs b/StaticAnalysis/All.hs
index 7b58738..5fab9b8 100644
--- a/StaticAnalysis/All.hs
+++ b/StaticAnalysis/All.hs
@@ -1,8 +1,9 @@
----------------------------------------------------------------
--
--- StaticAnalysis
+-- | StaticAnalysis
+--
+-- @StaticAnalysis\/All.hs@
--
--- StaticAnalysis/All.hs
-- Wrapper module for all StaticAnalysis modules.
--
@@ -11,13 +12,15 @@
module StaticAnalysis.All (
module StaticAnalysis.Analysis,
- module StaticAnalysis.Annotated
+ module StaticAnalysis.Annotate,
+ module StaticAnalysis.Analyze
)
where
import StaticAnalysis.Analysis
-import StaticAnalysis.Annotated
+import StaticAnalysis.Annotate
+import StaticAnalysis.Analyze
diff --git a/StaticAnalysis/Analysis.hs b/StaticAnalysis/Analysis.hs
index 6d2960e..c82a3ed 100644
--- a/StaticAnalysis/Analysis.hs
+++ b/StaticAnalysis/Analysis.hs
@@ -1,8 +1,9 @@
----------------------------------------------------------------
--
--- StaticAnalysis
+-- | StaticAnalysis
+--
+-- @StaticAnalysis\/Analysis.hs@
--
--- StaticAnalysis/Analysis.hs
-- Interface for data structure that represents static
-- analysis results.
--
@@ -10,14 +11,25 @@
----------------------------------------------------------------
--
+{-# LANGUAGE MultiParamTypeClasses #-}
+
module StaticAnalysis.Analysis
where
----------------------------------------------------------------
--- Interface for analysis result data structures.
+-- | Interface for analysis result data structures.
class Analysis a where
unanalyzed :: a
+----------------------------------------------------------------
+-- | Interface for analysis result data structures with multiple
+-- analysis components.
+
+class (Analysis a, Analysis b) => Component b a where
+ project :: a -> b
+ inject :: b -> a -> a
+
+
--eof
diff --git a/StaticAnalysis/Analyze.hs b/StaticAnalysis/Analyze.hs
new file mode 100644
index 0000000..b7aa0e3
--- /dev/null
+++ b/StaticAnalysis/Analyze.hs
@@ -0,0 +1,35 @@
+----------------------------------------------------------------
+--
+-- | StaticAnalysis
+--
+-- @StaticAnalysis\/Annotated.hs@
+--
+-- Interface for abstract syntax data structures in which
+-- every node can be annotated with a data structure that
+-- represents static analysis results.
+--
+
+----------------------------------------------------------------
+--
+
+{-# LANGUAGE MultiParamTypeClasses #-}
+
+module StaticAnalysis.Analyze
+ where
+
+import StaticAnalysis.Analysis (Analysis(..))
+import StaticAnalysis.Annotate (Annotate(..))
+
+----------------------------------------------------------------
+-- | Interface for abstract syntax data structures that can be
+-- analyzed.
+
+class (Annotate d, Analysis a) => Analyze d a where
+
+ -- The function for applying the algorithm to a data structure
+ -- of type d a.
+ analyze :: d a -> d a
+
+
+
+--eof
diff --git a/StaticAnalysis/Annotated.hs b/StaticAnalysis/Annotate.hs
index 6cba272..897a3c6 100644
--- a/StaticAnalysis/Annotated.hs
+++ b/StaticAnalysis/Annotate.hs
@@ -1,8 +1,9 @@
----------------------------------------------------------------
--
--- StaticAnalysis
+-- | StaticAnalysis
+--
+-- @StaticAnalysis\/Annotate.hs@
--
--- StaticAnalysis/Annotated.hs
-- Interface for abstract syntax data structures in which
-- every node can be annotated with a data structure that
-- represents static analysis results.
@@ -11,16 +12,17 @@
----------------------------------------------------------------
--
-module StaticAnalysis.Annotated
+module StaticAnalysis.Annotate
where
import StaticAnalysis.Analysis
----------------------------------------------------------------
--- Interface for abstract syntax data structures.
+-- | Interface for abstract syntax data structures that can be
+-- annotated.
-class Annotated d where
- annotate :: Analysis a => d a -> a -> d a
+class Annotate d where
+ annotate :: Analysis a => a -> d a -> d a
annotation :: Analysis a => d a -> a
diff --git a/staticanalysis.cabal b/staticanalysis.cabal
index 6263252..b25a9e6 100644
--- a/staticanalysis.cabal
+++ b/staticanalysis.cabal
@@ -1,5 +1,5 @@
Name: staticanalysis
-Version: 0.0.0.1
+Version: 0.0.0.2
Cabal-Version: >= 1.6
License: GPL-3
License-File: LICENSE
@@ -13,7 +13,8 @@ Build-Type: Simple
Library
Exposed-Modules: StaticAnalysis.All,
StaticAnalysis.Analysis,
- StaticAnalysis.Annotated
+ StaticAnalysis.Annotate,
+ StaticAnalysis.Analyze
Build-Depends: base >= 3 && < 5,
MissingH