diff options
| author | krasimir <krasimir@chalmers.se> | 2009-12-13 18:50:29 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2009-12-13 18:50:29 +0000 |
| commit | f85232947e74ee7ef8c7b0ad2338212e7e68f1be (patch) | |
| tree | 667b886a5e3a4b026a63d4e3597f32497d824761 /src/GF/Infra/Dependencies.hs | |
| parent | d88a865faff59c98fc91556ff8700b10ee5f2df8 (diff) | |
reorganize the directories under src, and rescue the JavaScript interpreter from deprecated
Diffstat (limited to 'src/GF/Infra/Dependencies.hs')
| -rw-r--r-- | src/GF/Infra/Dependencies.hs | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/GF/Infra/Dependencies.hs b/src/GF/Infra/Dependencies.hs deleted file mode 100644 index af2088711..000000000 --- a/src/GF/Infra/Dependencies.hs +++ /dev/null @@ -1,61 +0,0 @@ -module GF.Infra.Dependencies ( - depGraph - ) where - -import GF.Grammar.Grammar -import GF.Infra.Modules -import GF.Infra.Ident - -depGraph :: SourceGrammar -> String -depGraph = prDepGraph . grammar2moddeps - -prDepGraph :: [(Ident,ModDeps)] -> String -prDepGraph deps = unlines $ [ - "digraph {" - ] ++ - map mkNode deps ++ - concatMap mkArrows deps ++ [ - "}" - ] - where - mkNode (i,dep) = unwords [showIdent i, "[",nodeAttr (modtype dep),"]"] - nodeAttr ty = case ty of - MTAbstract -> "style = \"solid\", shape = \"box\"" - MTConcrete _ -> "style = \"solid\", shape = \"ellipse\"" - _ -> "style = \"dashed\", shape = \"ellipse\"" - mkArrows (i,dep) = - [unwords [showIdent i,"->",showIdent j,"[",arrowAttr "of","]"] | j <- ofs dep] ++ - [unwords [showIdent i,"->",showIdent j,"[",arrowAttr "ex","]"] | j <- extendeds dep] ++ - [unwords [showIdent i,"->",showIdent j,"[",arrowAttr "op","]"] | j <- openeds dep] ++ - [unwords [showIdent i,"->",showIdent j,"[",arrowAttr "ed","]"] | j <- extrads dep] - arrowAttr s = case s of - "of" -> "style = \"solid\", arrowhead = \"empty\"" - "ex" -> "style = \"solid\"" - "op" -> "style = \"dashed\"" - "ed" -> "style = \"dotted\"" - -data ModDeps = ModDeps { - modtype :: ModuleType Ident, - ofs :: [Ident], - extendeds :: [Ident], - openeds :: [Ident], - extrads :: [Ident], - functors :: [Ident], - interfaces :: [Ident], - instances :: [Ident] - } - -noModDeps = ModDeps MTAbstract [] [] [] [] [] [] [] - -grammar2moddeps :: SourceGrammar -> [(Ident,ModDeps)] -grammar2moddeps gr = [(i,depMod m) | (i,m) <- modules gr] where - depMod m = noModDeps{ - modtype = mtype m, - ofs = case mtype m of - MTConcrete i -> [i] - MTInstance i -> [i] - _ -> [], - extendeds = map fst (extend m), - openeds = map openedModule (opens m), - extrads = mexdeps m - } |
