forked from GitHub/gf-core
use parser combinators to parse the shell commands. simplified CommandLine type
This commit is contained in:
28
src-3.0/GF/Command/Abstract.hs
Normal file
28
src-3.0/GF/Command/Abstract.hs
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user