From 4803fb8052caba0421949c9d7768d44ec28d109d Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Thu, 5 Jun 2008 07:33:42 +0000 Subject: use parser combinators to parse the shell commands. simplified CommandLine type --- src-3.0/GF/Command/Abstract.hs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src-3.0/GF/Command/Abstract.hs (limited to 'src-3.0/GF/Command/Abstract.hs') diff --git a/src-3.0/GF/Command/Abstract.hs b/src-3.0/GF/Command/Abstract.hs new file mode 100644 index 000000000..127cbf6e0 --- /dev/null +++ b/src-3.0/GF/Command/Abstract.hs @@ -0,0 +1,28 @@ +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 + deriving (Eq,Ord,Show) + +data Argument + = AExp Exp + | ANoArg + deriving (Eq,Ord,Show) -- cgit v1.2.3