summaryrefslogtreecommitdiff
path: root/src-3.0/GF/Command/Abstract.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-25 16:54:35 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-25 16:54:35 +0000
commite9e80fc389365e24d4300d7d5390c7d833a96c50 (patch)
treef0b58473adaa670bd8fc52ada419d8cad470ee03 /src-3.0/GF/Command/Abstract.hs
parentb96b36f43de3e2f8b58d5f539daa6f6d47f25870 (diff)
changed names of resource-1.3; added a note on homepage on release
Diffstat (limited to 'src-3.0/GF/Command/Abstract.hs')
-rw-r--r--src-3.0/GF/Command/Abstract.hs67
1 files changed, 0 insertions, 67 deletions
diff --git a/src-3.0/GF/Command/Abstract.hs b/src-3.0/GF/Command/Abstract.hs
deleted file mode 100644
index 29111b432..000000000
--- a/src-3.0/GF/Command/Abstract.hs
+++ /dev/null
@@ -1,67 +0,0 @@
-module GF.Command.Abstract where
-
-import PGF.Data
-
-type Ident = String
-
-type CommandLine = [Pipe]
-
-type Pipe = [Command]
-
-data Command
- = Command Ident [Option] Argument
- deriving (Eq,Ord,Show)
-
-data Option
- = OOpt Ident
- | OFlag Ident Value
- deriving (Eq,Ord,Show)
-
-data Value
- = VId Ident
- | VInt Integer
- | VStr String
- deriving (Eq,Ord,Show)
-
-data Argument
- = ATree Tree
- | ANoArg
- | AMacro Ident
- deriving (Eq,Ord,Show)
-
-valIdOpts :: String -> String -> [Option] -> String
-valIdOpts flag def opts = case valOpts flag (VId def) opts of
- VId v -> v
- _ -> def
-
-valIntOpts :: String -> Integer -> [Option] -> Int
-valIntOpts flag def opts = fromInteger $ case valOpts flag (VInt def) opts of
- VInt v -> v
- _ -> def
-
-valStrOpts :: String -> String -> [Option] -> String
-valStrOpts flag def opts = case valOpts flag (VStr def) opts of
- VStr v -> v
- _ -> def
-
-valOpts :: String -> Value -> [Option] -> Value
-valOpts flag def opts = case lookup flag flags of
- Just v -> v
- _ -> def
- where
- flags = [(f,v) | OFlag f v <- opts]
-
-isOpt :: String -> [Option] -> Bool
-isOpt o opts = elem o [x | OOpt x <- opts]
-
-isFlag :: String -> [Option] -> Bool
-isFlag o opts = elem o [x | OFlag x _ <- opts]
-
-prOpt :: Option -> String
-prOpt o = case o of
- OOpt i -> i
- OFlag f x -> f ++ "=" ++ show x
-
-mkOpt :: String -> Option
-mkOpt = OOpt
-