Permalink
Browse files

avoid clumsy extra lib for now

  • Loading branch information...
1 parent b3c8fbd commit 991bd4f15845965f5669d587fe0742896542f9ac Alexander Bernauer committed Jun 22, 2012
View
@@ -7,30 +7,8 @@ import Data.Maybe (fromMaybe)
import Data.Typeable (Typeable)
import Language.C.Data.Node (lengthOfNode, isUndefNode, posOfNode, CNode(nodeInfo), NodeInfo, undefNode)
import Language.C.Data.Position (posRow, posColumn)
-import Ocram.Symbols (Symbol)
import Ocram.Util (abort)
-
-data File = -- {{{1
- File {fileName :: String, fileChecksum :: String}
-
-data TLocation = -- {{{1
- TLocation {tlocRow :: Int, tlocCol :: Int, tlocLen :: Int}
-
-instance Show TLocation where
- show (TLocation r c l) = show (r, c, l)
-
-data ELocation = -- {{{1
- ELocation {elocRow :: Int, elocCol :: Int, elocTidd :: Maybe Int}
-
-instance Show ELocation where
- show (ELocation r c t) = show (r, c, t)
-
-data Location = Location TLocation ELocation -- {{{1
-
-type LocMap = [Location] -- {{{1
-
-type Variable = Symbol -- {{{1
-type VarMap = [(Variable, Variable)]
+import Ocram.Ruab
data ENodeInfo = ENodeInfo { -- {{{1
tnodeInfo :: NodeInfo,
View
@@ -45,7 +45,8 @@ import Control.Arrow (first)
import Language.C.Syntax
import Language.C.Data.Ident (Ident, identToString)
import Text.PrettyPrint
-import Ocram.Debug (ENodeInfo(threadId), ELocation(ELocation), Location(Location), LocMap, validBreakpoint, tlocation)
+import Ocram.Debug (ENodeInfo(threadId), validBreakpoint, tlocation)
+import Ocram.Ruab (ELocation(ELocation), Location(Location), LocMap)
import Ocram.Util (abort)
import qualified Data.ByteString.Char8 as BS
View
@@ -0,0 +1,33 @@
+module Ocram.Ruab where
+
+data TLocation = TLocation {
+ tlocRow :: Int
+ , tlocCol :: Int
+ , tlocLen :: Int
+ } deriving (Show, Read)
+
+data ELocation = ELocation {
+ elocRow :: Int
+ , elocCol :: Int
+ , elocTidd :: Maybe Int
+ } deriving (Show, Read)
+
+data Location = Location TLocation ELocation deriving (Show, Read)
+
+type LocMap = [Location]
+
+type Variable = String
+type VarMap = [(Variable, Variable)]
+
+data File = File {
+ fileName :: FilePath
+ , fileChecksum :: String
+ } deriving (Show, Read)
+
+data DebugInfo = DebugInfo {
+ diTcode :: File
+ , diEcode :: File
+ , diLocMap :: LocMap
+ , diVarMap :: VarMap
+ } deriving (Show, Read)
+
@@ -8,7 +8,8 @@ module Ocram.Transformation
import Data.Generics (everything, mkQ)
import Language.C.Syntax.AST
import Ocram.Analysis (CallGraph, blocking_functions)
-import Ocram.Debug (enrichNodeInfo, VarMap, un)
+import Ocram.Debug (enrichNodeInfo, un)
+import Ocram.Ruab (VarMap)
import Ocram.Symbols (symbol)
import Ocram.Transformation.Normalize (normalize)
import Ocram.Transformation.Translate (translate)
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,25 +0,0 @@
--- vim: set expandtab:
-Name: ocramruab
-Version: 0.1
-Synopsis: Threads-to-Events compiler (debug information)
-Homepage: https://github.com/copton/ocram
-License: GPL-2
-License-file: LICENSE
-Author: Alexander Bernauer <bernauer@inf.ethz.ch>
-Maintainer: Alexander Bernauer <bernauer@inf.ethz.ch>
-Category: Development
-Tested-with: GHC==7.0.3
-Build-type: Simple
-Stability: Experimental
-Description: Translating cooperative threads into a semantically equivalent reactive code, thus combining the comfort of sequential programing with the efficiency of event-based systems.
-
-Cabal-version: >=1.10
-
-Library
- Hs-Source-Dirs: src
- Ghc-Options: -Wall
- Default-Language: Haskell98
- Exposed-Modules:
- OcramRuab
- Build-Depends:
- base >= 4 && < 5
@@ -1,4 +0,0 @@
-module OcramRuab where
-
-data VarMap = VarMap
-data LocMap = LocMap
View
@@ -38,6 +38,7 @@ Executable ruab
ocramruab == 0.1.*
Other-Modules:
Main,
+ Ocram.Ruab,
Ruab.Main,
Ruab.Frontend,
Ruab.Mapping,
View
View
@@ -10,6 +10,7 @@ import Ruab.Backend
import Ruab.Options
import Ruab.Test (runTests)
import System.Environment (getArgs)
+import Ocram.Ruab
main :: IO () -- {{{1
main = do

0 comments on commit 991bd4f

Please sign in to comment.