summaryrefslogtreecommitdiff
path: root/src/runtime/haskell-bind/examples
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2014-02-09 20:45:11 +0000
committerkr.angelov <kr.angelov@gmail.com>2014-02-09 20:45:11 +0000
commitadeeb47e06cba3ac76b585b068324fac0446bad0 (patch)
tree1302eaf67e012646c2072c55a946247447fbe5cc /src/runtime/haskell-bind/examples
parentf30c60c3d7cfc2dbaca7e1ba0abf953b9c3caa63 (diff)
cleanup the code for the FFI binding. The API is now more uniform with the Python and the Java bindings. Fixed a lot of memory leaks.
Diffstat (limited to 'src/runtime/haskell-bind/examples')
-rw-r--r--src/runtime/haskell-bind/examples/pgf-shell.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/haskell-bind/examples/pgf-shell.hs b/src/runtime/haskell-bind/examples/pgf-shell.hs
index fbb4c4023..1159ea794 100644
--- a/src/runtime/haskell-bind/examples/pgf-shell.hs
+++ b/src/runtime/haskell-bind/examples/pgf-shell.hs
@@ -13,9 +13,9 @@ import qualified Data.Map as M
import System.IO(hFlush,stdout)
import System.IO.Error(catchIOError)
import System.Environment
-import CRuntimeFFI
-import CId
+import PGF2
import System.Mem(performGC)
+import qualified Data.Map as Map
main = getPGF =<< getArgs
@@ -42,13 +42,13 @@ execute pgf cmd =
getConcr' pgf lang =
maybe (fail $ "Concrete syntax not found: "++show lang) return $
- getConcr pgf lang
+ Map.lookup lang (languages pgf)
printl xs = putl $ map show xs
putl = putStr . unlines
-- | Abstracy syntax of shell commands
-data Command = P CId String | L CId Tree | T CId CId String deriving Show
+data Command = P String String | L String Expr | T String String String deriving Show
-- | Shell command parser
instance Read Command where