diff options
author | Csaba Hruska <csaba.hruska@gmail.com> | 2015-09-26 10:53:48 +0200 |
---|---|---|
committer | Csaba Hruska <csaba.hruska@gmail.com> | 2015-09-26 10:53:48 +0200 |
commit | b010b1e7006d6ffcf226590dd9bac04a694f8cbd (patch) | |
tree | de8a6afaed9b82cda73b7cee37a3b9b5477677e5 /Generate.hs | |
parent | 307895ce6e4fb875afba0999c257b573eff6aa4c (diff) |
ddl: initial swift backend
Diffstat (limited to 'Generate.hs')
-rw-r--r-- | Generate.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Generate.hs b/Generate.hs index a35cb66..4eea1dc 100644 --- a/Generate.hs +++ b/Generate.hs | |||
@@ -22,6 +22,8 @@ instance Unquote Type | |||
22 | 22 | ||
23 | main :: IO () | 23 | main :: IO () |
24 | main = do | 24 | main = do |
25 | dataSwift <- eitherParseFile "templates/data.swift.ede" | ||
26 | dataJava <- eitherParseFile "templates/data.java.ede" | ||
25 | dataHpp <- eitherParseFile "templates/data.hpp.ede" | 27 | dataHpp <- eitherParseFile "templates/data.hpp.ede" |
26 | dataCpp <- eitherParseFile "templates/data.cpp.ede" | 28 | dataCpp <- eitherParseFile "templates/data.cpp.ede" |
27 | dataCs <- eitherParseFile "templates/data.cs.ede" | 29 | dataCs <- eitherParseFile "templates/data.cs.ede" |
@@ -46,6 +48,8 @@ main = do | |||
46 | , "psType" @: psType aliasMap | 48 | , "psType" @: psType aliasMap |
47 | , "cppType" @: cppType aliasMap | 49 | , "cppType" @: cppType aliasMap |
48 | , "csType" @: csType aliasMap | 50 | , "csType" @: csType aliasMap |
51 | , "javaType" @: javaType aliasMap | ||
52 | , "swiftType" @: swiftType aliasMap | ||
49 | ] | 53 | ] |
50 | 54 | ||
51 | -- Haskell | 55 | -- Haskell |
@@ -55,6 +59,12 @@ main = do | |||
55 | -- C++ | 59 | -- C++ |
56 | either error (\x -> writeFile ("out/" ++ name ++ ".hpp") $ LText.unpack x) $ dataHpp >>= (\t -> eitherRenderWith mylib t env) | 60 | either error (\x -> writeFile ("out/" ++ name ++ ".hpp") $ LText.unpack x) $ dataHpp >>= (\t -> eitherRenderWith mylib t env) |
57 | either error (\x -> writeFile ("out/" ++ name ++ ".cpp") $ LText.unpack x) $ dataCpp >>= (\t -> eitherRenderWith mylib t env) | 61 | either error (\x -> writeFile ("out/" ++ name ++ ".cpp") $ LText.unpack x) $ dataCpp >>= (\t -> eitherRenderWith mylib t env) |
62 | {- | ||
63 | -- Java | ||
64 | either error (\x -> writeFile ("out/" ++ name ++ ".java") $ LText.unpack x) $ dataJava >>= (\t -> eitherRenderWith mylib t env) | ||
58 | -- C# | 65 | -- C# |
59 | either error (\x -> writeFile ("out/" ++ name ++ ".cs") $ LText.unpack x) $ dataCs >>= (\t -> eitherRenderWith mylib t env) | 66 | either error (\x -> writeFile ("out/" ++ name ++ ".cs") $ LText.unpack x) $ dataCs >>= (\t -> eitherRenderWith mylib t env) |
67 | -} | ||
68 | -- Swift | ||
69 | either error (\x -> writeFile ("out/" ++ name ++ ".swift") $ LText.unpack x) $ dataSwift >>= (\t -> eitherRenderWith mylib t env) | ||
60 | mapM_ generate $ execWriter modules | 70 | mapM_ generate $ execWriter modules |