SyntaxMacros-0.2: Syntax Macros in the form of an EDSL

Language.Grammars.Grammar

Documentation

data Grammar a Source

Constructors

forall env . Grammar (Ref a env) (Env Productions env env) 

newtype Productions a env Source

Constructors

PS 

Fields

unPS :: [Prod a env]
 

data Prod a env whereSource

Constructors

Seq :: Symbol b t env -> Prod (b -> a) env -> Prod a env 
End :: a -> Prod a env 

data DTerm Source

Constructors

DTerm 

Instances

ProdSeq (Symbol DTerm TTerm) (PreProd (t1 -> DTerm -> t2) (DTerm -> a)) (t1 -> t2) a 

data TTerm Source

Instances

ProdSeq (Symbol DTerm TTerm) (PreProd (t1 -> DTerm -> t2) (DTerm -> a)) (t1 -> t2) a 

data TNonT Source

Instances

GetNT nt (NTCons nt v l env) (Symbol v TNonT env) 
HExtend (LVPair t v) l l' => ProdSeq (EP t (Symbol b TNonT)) (PreProd (l -> v -> t2) (b -> a)) (l' -> t2) a 

data TAttT Source

Instances

HExtend (LVPair t (Record HNil -> v)) l l' => ProdSeq (EP t (Symbol b TAttT)) (PreProd (l -> v -> t2) (b -> a)) (l' -> t2) a 

data Symbol a t env whereSource

Constructors

Term :: String -> Symbol DTerm TTerm env 
Nont :: Ref a env -> Symbol a TNonT env 
NontInt :: Symbol Int TAttT env 
NontChar :: Symbol Char TAttT env 
NontVarid :: Symbol String TAttT env 
NontConid :: Symbol String TAttT env 
NontOp :: Symbol String TAttT env 

Instances

GetNT nt (NTCons nt v l env) (Symbol v TNonT env) 
HExtend (LVPair t (Record HNil -> v)) l l' => ProdSeq (EP t (Symbol b TAttT)) (PreProd (l -> v -> t2) (b -> a)) (l' -> t2) a 
HExtend (LVPair t v) l l' => ProdSeq (EP t (Symbol b TNonT)) (PreProd (l -> v -> t2) (b -> a)) (l' -> t2) a 
ProdSeq (Symbol DTerm TTerm) (PreProd (t1 -> DTerm -> t2) (DTerm -> a)) (t1 -> t2) a 

getRefNT :: Symbol a TNonT env -> Ref a envSource

pairEq :: Maybe (Equal a b) -> Maybe (Equal (a, t) (b, t))Source

matchSym :: Symbol a t1 env -> Symbol b t2 env -> Maybe (Equal (a, t1) (b, t2))Source

append :: (a -> b -> c) -> Prod a env -> Symbol b t env -> Prod c envSource

data EP a b env Source

Constructors

EP a (b env) 

Instances

HExtend (LVPair t (Record HNil -> v)) l l' => ProdSeq (EP t (Symbol b TAttT)) (PreProd (l -> v -> t2) (b -> a)) (l' -> t2) a 
HExtend (LVPair t v) l l' => ProdSeq (EP t (Symbol b TNonT)) (PreProd (l -> v -> t2) (b -> a)) (l' -> t2) a 

(<=>) :: a -> b env -> EP a b envSource

data PreProd a b env Source

Constructors

PreProd (a -> Prod b env) 

Instances

HExtend (LVPair t (Record HNil -> v)) l l' => ProdSeq (EP t (Symbol b TAttT)) (PreProd (l -> v -> t2) (b -> a)) (l' -> t2) a 
HExtend (LVPair t v) l l' => ProdSeq (EP t (Symbol b TNonT)) (PreProd (l -> v -> t2) (b -> a)) (l' -> t2) a 
ProdSeq (Symbol DTerm TTerm) (PreProd (t1 -> DTerm -> t2) (DTerm -> a)) (t1 -> t2) a 

class ProdSeq a b c d | a c -> b d whereSource

Methods

(<.>) :: a env -> b env -> PreProd c d envSource

Instances

HExtend (LVPair t (Record HNil -> v)) l l' => ProdSeq (EP t (Symbol b TAttT)) (PreProd (l -> v -> t2) (b -> a)) (l' -> t2) a 
HExtend (LVPair t v) l l' => ProdSeq (EP t (Symbol b TNonT)) (PreProd (l -> v -> t2) (b -> a)) (l' -> t2) a 
ProdSeq (Symbol DTerm TTerm) (PreProd (t1 -> DTerm -> t2) (DTerm -> a)) (t1 -> t2) a 

prd :: (a -> b) -> PreProd (a -> b) t t1 -> Prod t t1Source

prdId :: Symbol a TNonT env -> Prod a envSource