Copyright | (c) Juan García Garland Marcos Viera 2019 |
---|---|
License | GPL |
Maintainer | jpgarcia@fing.edu.uy |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- class Use' (mnts :: Bool) (att :: Att) (prd :: Prod) (nts :: [NT]) (a :: Type) sc where
- class Use (att :: Att) (prd :: Prod) (nts :: [NT]) (a :: Type) sc where
- class Empties (fc :: [(Child, Type)]) (prd :: Prod) where
- class Kn (fcr :: [(Child, Type)]) (prd :: Prod) where
- class At pos att m where
- data Lhs
- type family SP (rule :: Type) where ...
- type family IC (rule :: Type) where ...
- data OpComRA' (b :: Bool) (ctx :: [ErrorMessage]) (prd :: Prod) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (ic :: [(Child, [(Att, Type)])]) (sp :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sp' :: [(Att, Type)]) (a :: [(Prod, Type)]) where
- data OpComRA (ctx :: [ErrorMessage]) (prd :: Prod) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (ic :: [(Child, [(Att, Type)])]) (sp :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sp' :: [(Att, Type)]) (a :: [(Prod, Type)]) where
- data OpComAsp (al :: [(Prod, Type)]) (ar :: [(Prod, Type)]) where
- class MapCtxAsp (r :: [(Prod, Type)]) (ctx :: [ErrorMessage]) (ctx' :: [ErrorMessage]) where
- newtype CAspect (ctx :: [ErrorMessage]) (asp :: [(Prod, Type)]) = CAspect {}
- newtype CRule (ctx :: [ErrorMessage]) prd sc ip ic sp ic' sp' = CRule {}
- type Rule (prd :: Prod) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (ic :: [(Child, [(Att, Type)])]) (sp :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sp' :: [(Att, Type)]) = Fam prd sc ip -> Fam prd ic sp -> Fam prd ic' sp'
- data Fam (prd :: Prod) (c :: [(Child, [(Att, Type)])]) (p :: [(Att, Type)]) :: Type where
- Fam :: ChAttsRec prd c -> Attribution p -> Fam prd c p
- class SemLit a where
- sem_Lit :: a -> Attribution ('[] :: [(Att, Type)]) -> Attribution '['(Att "term" a, a)]
- lit :: Label (Att "term" a)
- chi :: Fam prd c p -> ChAttsRec prd c
- par :: Fam prd c p -> Attribution p
- prd :: Fam prd c p -> Label prd
- emptyAspect :: CAspect ctx '[]
- comAspect :: (Require (OpComAsp al ar) ctx, ReqR (OpComAsp al ar) ~ Aspect asp) => CAspect ctx al -> CAspect ctx ar -> CAspect ctx asp
- traceAspect :: MapCtxAsp r ctx ((Text "aspect " :<>: e) ': ctx) => Proxy e -> CAspect ((Text "aspect " :<>: e) ': ctx) r -> CAspect ctx (ResMapCtx r ctx ((Text "aspect " :<>: e) ': ctx))
- traceRule :: Proxy e -> CRule ((Text "rule " :<>: e) ': ctx) prd sc ip ic sp ic' sp' -> CRule ctx prd sc ip ic sp ic' sp'
- mapCRule :: (Proxy ctx -> Proxy ctx') -> CRule ctx' prd sc ip ic sp ic' sp' -> CRule ctx prd sc ip ic sp ic' sp'
- mapCAspect :: MapCtxAsp r ctx1 ctx2 => (Proxy ctx1 -> Proxy ctx2) -> CAspect ctx2 r -> CAspect ctx1 (ResMapCtx r ctx1 ctx2)
- extAspect :: RequireR (OpComRA ctx prd sc ip ic sp ic' sp' a) ctx (Aspect asp) => CRule ctx prd sc ip ic sp ic' sp' -> CAspect ctx a -> CAspect ctx asp
- (.+:) :: (Require (OpComRA' (HasLabel prd a) ctx prd sc ip ic sp ic' sp' a) ctx, ReqR (OpComRA' (HasLabel prd a) ctx prd sc ip ic sp ic' sp' a) ~# Rec PrdReco asp) => CRule ctx prd sc ip ic sp ic' sp' -> CAspect ctx a -> CAspect ctx asp
- (.:+.) :: (Require (OpComRA' (HasLabel prd a) ctx prd sc ip ic sp ic' sp' a) ctx, ReqR (OpComRA' (HasLabel prd a) ctx prd sc ip ic sp ic' sp' a) ~# Rec PrdReco asp) => CAspect ctx a -> CRule ctx prd sc ip ic sp ic' sp' -> CAspect ctx asp
- (.:+:) :: (Require (OpComAsp al ar) ctx, ReqR (OpComAsp al ar) ~# Rec PrdReco asp) => CAspect ctx al -> CAspect ctx ar -> CAspect ctx asp
- syndef :: (RequireEq t t' ctx', RequireR (OpExtend AttReco (Att att t) t sp) ctx (Attribution sp'), ctx' ~ (((((Text "syndef(" :<>: ShowT (Att att t)) :<>: Text ", ") :<>: ShowT prd) :<>: Text ")") ': ctx)) => Label (Att att t) -> Label prd -> (Proxy ctx' -> Fam prd sc ip -> t') -> CRule ctx prd sc ip ic sp ic sp'
- syndefM :: (RequireEq t t' ctx', RequireR (OpExtend AttReco (Att att t) t sp) ctx (Attribution sp'), ctx' ~ (((((Text "syndef(" :<>: ShowT (Att att t)) :<>: Text ", ") :<>: ShowT prd) :<>: Text ")") ': ctx)) => Label (Att att t) -> Label prd -> Reader (Proxy ctx', Fam prd sc ip) t' -> CRule ctx prd sc ip ic sp ic sp'
- syn :: (Require (OpExtend' (LabelSetF ((,) (Att att t') t' ': sp)) AttReco (Att att t') t' sp) ctx, ReqR (OpExtend' (LabelSetF ((,) (Att att t') t' ': sp)) AttReco (Att att t') t' sp) ~# Rec AttReco sp') => Label (Att att t') -> Label prd -> Reader (Proxy (((((Text "syndef(" :<>: (((Text "Attribute " :<>: Text att) :<>: Text ":") :<>: ShowType t')) :<>: Text ", ") :<>: ShowT prd) :<>: Text ")") ': ctx), Fam prd sc ip) t' -> CRule ctx prd sc ip ic sp ic sp'
- inh :: (Require (OpExtend' (LabelSetF ((,) (Att att t') t' ': r)) AttReco (Att att t') t' r) ctx, Require (OpUpdate (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) (Left n :: Either NT T)) v2 ic) ctx, Require (OpLookup (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) (Left n :: Either NT T)) ic) ctx, ReqR (OpLookup (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) (Left n :: Either NT T)) ic) ~# Rec AttReco r, ReqR (OpExtend' (LabelSetF ((,) (Att att t') t' ': r)) AttReco (Att att t') t' r) ~# Rec AttReco v2, ReqR (OpUpdate (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) (Left n :: Either NT T)) v2 ic) ~# Rec (ChiReco (Prd prd nt)) ic') => Label (Att att t') -> Label (Prd prd nt) -> Label (Chi chi (Prd prd nt) (Left n :: Either NT T)) -> Reader (Proxy (((((((Text "inhdef(" :<>: (((Text "Attribute " :<>: Text att) :<>: Text ":") :<>: ShowType t')) :<>: Text ", ") :<>: ((ShowT nt :<>: Text "::Production ") :<>: Text prd)) :<>: Text ", ") :<>: ((((((ShowT nt :<>: Text "::Production ") :<>: Text prd) :<>: Text "::Child ") :<>: Text chi) :<>: Text ":") :<>: ShowT n)) :<>: Text ")") ': ctx), Fam (Prd prd nt) sc ip) t' -> CRule ctx (Prd prd nt) sc ip ic sp ic' sp
- synmod :: RequireR (OpUpdate AttReco (Att att t) t r) ctx (Attribution sp') => Label (Att att t) -> Label prd -> (Proxy (((((Text "synmod(" :<>: ShowT (Att att t)) :<>: Text ", ") :<>: ShowT prd) :<>: Text ")") ': ctx) -> Fam prd sc ip -> t) -> CRule ctx prd sc ip ic' r ic' sp'
- synmodM :: RequireR (OpUpdate AttReco (Att att t) t r) ctx (Attribution sp') => Label (Att att t) -> Label prd -> Reader (Proxy (((((Text "synmod(" :<>: ShowT (Att att t)) :<>: Text ", ") :<>: ShowT prd) :<>: Text ")") ': ctx), Fam prd sc ip) t -> CRule ctx prd sc ip ic' r ic' sp'
- inhdef :: (RequireEq t t' ctx', RequireR (OpExtend AttReco (Att att t) t r) ctx (Attribution v2), RequireR (OpUpdate (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) ntch) v2 ic) ctx (ChAttsRec (Prd prd nt) ic'), RequireR (OpLookup (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) ntch) ic) ctx (Attribution r), RequireEq ntch (Left n) ctx', ctx' ~ (((((((Text "inhdef(" :<>: ShowT (Att att t)) :<>: Text ", ") :<>: ShowT (Prd prd nt)) :<>: Text ", ") :<>: ShowT (Chi chi (Prd prd nt) ntch)) :<>: Text ")") ': ctx)) => Label (Att att t) -> Label (Prd prd nt) -> Label (Chi chi (Prd prd nt) ntch) -> (Proxy ctx' -> Fam (Prd prd nt) sc ip -> t') -> CRule ctx (Prd prd nt) sc ip ic sp ic' sp
- inhdefM :: (RequireEq t t' ctx', RequireR (OpExtend' (LabelSetF ('(Att att t, t) ': r)) AttReco (Att att t) t r) ctx (Attribution v2), RequireR (OpUpdate (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) ntch) v2 ic) ctx (ChAttsRec (Prd prd nt) ic'), RequireR (OpLookup (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) ntch) ic) ctx (Attribution r), RequireEq ntch (Left n) ctx', ctx' ~ (((((((Text "inhdef(" :<>: ShowT (Att att t')) :<>: Text ", ") :<>: ShowT (Prd prd nt)) :<>: Text ", ") :<>: ShowT (Chi chi (Prd prd nt) ntch)) :<>: Text ")") ': ctx)) => Label (Att att t) -> Label (Prd prd nt) -> Label (Chi chi (Prd prd nt) ntch) -> Reader (Proxy ctx', Fam (Prd prd nt) sc ip) t' -> CRule ctx (Prd prd nt) sc ip ic sp ic' sp
- inhmod :: (RequireEq t t' ctx', RequireR (OpUpdate AttReco (Att att t) t r) ctx (Attribution v2), RequireR (OpUpdate (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) ntch) v2 ic) ctx (ChAttsRec (Prd prd nt) ic'), RequireR (OpLookup (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) ntch) ic) ctx (Attribution r), RequireEq ntch (Left n) ctx', ctx' ~ (((((((Text "inhmod(" :<>: ShowT (Att att t)) :<>: Text ", ") :<>: ShowT (Prd prd nt)) :<>: Text ", ") :<>: ShowT (Chi chi (Prd prd nt) ntch)) :<>: Text ")") ': ctx)) => Label (Att att t) -> Label (Prd prd nt) -> Label (Chi chi (Prd prd nt) ntch) -> (Proxy ctx' -> Fam (Prd prd nt) sc ip -> t') -> CRule ctx (Prd prd nt) sc ip ic sp ic' sp
- inhmodM :: (RequireEq t t' ctx', RequireR (OpUpdate AttReco (Att att t) t r) ctx (Attribution v2), RequireR (OpUpdate (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) ntch) v2 ic) ctx (ChAttsRec (Prd prd nt) ic'), RequireR (OpLookup (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) ntch) ic) ctx (Attribution r), RequireEq ntch (Left n) ctx', ctx' ~ (((((((Text "inhmod(" :<>: ShowT (Att att t)) :<>: Text ", ") :<>: ShowT (Prd prd nt)) :<>: Text ", ") :<>: ShowT (Chi chi (Prd prd nt) ntch)) :<>: Text ")") ': ctx)) => Label (Att att t) -> Label (Prd prd nt) -> Label (Chi chi (Prd prd nt) ntch) -> Reader (Proxy ctx', Fam (Prd prd nt) sc ip) t' -> CRule ctx (Prd prd nt) sc ip ic sp ic' sp
- ext' :: CRule ctx prd sc ip ic sp ic' sp' -> CRule ctx prd sc ip a b ic sp -> CRule ctx prd sc ip a b ic' sp'
- ext :: RequireEq prd prd' (Text "ext" ': ctx) => CRule ctx prd sc ip ic sp ic' sp' -> CRule ctx prd' sc ip a b ic sp -> CRule ctx prd sc ip a b ic' sp'
- (.+.) :: CRule ctx prd' sc ip ic sp ic' sp' -> CRule ctx prd' sc ip a b ic sp -> CRule ctx prd' sc ip a b ic' sp'
- lhs :: Label Lhs
- def :: Reader (Proxy ctx, Fam prd chi par) a -> Proxy ctx -> Fam prd chi par -> a
- ter :: (RequireR (OpLookup (ChiReco prd) pos chi) ctx (Attribution r), RequireR (OpLookup AttReco (Att "term" t) r) ctx t', RequireEq prd prd' ctx, RequireEq t t' ctx, RequireEq pos (Chi ch prd (Right (T t))) ctx, m ~ Reader (Proxy ctx, Fam prd' chi par)) => Label pos -> m (ResAt pos (Att "term" t) m)
- emptyCtx :: Proxy ([] :: [k])
- knit' :: (Kn fc prd, Empties fc prd) => CRule '[] prd (SCh fc) ip (EmptiesR fc) '[] (ICh fc) sp -> Record fc -> Attribution ip -> Attribution sp
- knit :: (Empties fc prd, Kn fc prd) => Proxy ctx -> CRule ctx prd (SCh fc) ip (EmptiesR fc) ([] :: [(Att, Type)]) (ICh fc) sp -> Record fc -> Attribution ip -> Attribution sp
- knitAspect :: (Empties fc prd1, Kn fc prd1, Require (OpLookup PrdReco prd2 r) ((Text "knit" :<>: ShowT prd2) ': ([] :: [ErrorMessage])), ReqR (OpLookup PrdReco prd2 r) ~# CRule ([] :: [ErrorMessage]) prd1 (SCh fc) ip (EmptiesR fc) ([] :: [(Att, Type)]) (ICh fc) sp) => Label prd2 -> CAspect ([] :: [ErrorMessage]) r -> Record fc -> Attribution ip -> Attribution sp
- use :: (Require (OpExtend' (LabelSetF ((,) (Att att t') t' ': sp)) AttReco (Att att t') t' sp) ctx, Use (Att att t') prd nts t' sc, ReqR (OpExtend' (LabelSetF ((,) (Att att t') t' ': sp)) AttReco (Att att t') t' sp) ~# Rec AttReco sp') => Label (Att att t') -> Label prd -> KList nts -> (t' -> t' -> t') -> t' -> CAspect ctx ((,) prd (CRule ctx prd sc ip ic' sp ic' sp') ': ([] :: [(Prod, Type)]))
- singAsp :: CRule ctx prd sc ip ic sp ic' sp' -> CAspect ctx ((,) prd (CRule ctx prd sc ip ic sp ic' sp') ': ([] :: [(Prod, Type)]))
- tyAppAtt :: (forall b. Label (Att name b)) -> Proxy a -> Label (Att name a)
- tyAppChi :: (forall b. Label (Chi name prd b)) -> Proxy a -> Label (Chi name prd a)
- module Language.Grammars.AspectAG.HList
- module Language.Grammars.AspectAG.GenRecord
- module Language.Grammars.AspectAG.RecordInstances
- module Language.Grammars.AspectAG.TPrelude
Documentation
class Use' (mnts :: Bool) (att :: Att) (prd :: Prod) (nts :: [NT]) (a :: Type) sc where Source #
usechi' :: Proxy mnts -> Label att -> Label prd -> KList nts -> (a -> a -> a) -> ChAttsRec prd sc -> Maybe a Source #
Instances
(LabelSet ((,) (Chi ch prd (Left nt :: Either NT T)) attr ': cs), Use att prd nts a cs) => Use' False att prd nts a ((,) (Chi ch prd (Left nt :: Either NT T)) attr ': cs) Source # | |
(Require (OpLookup AttReco att attr) (((Text "looking up attribute " :<>: ShowT att) :$$: (Text "on " :<>: ShowT attr)) ': ([] :: [ErrorMessage])), ReqR (OpLookup AttReco att attr) ~ a, Use att prd nts a cs, LabelSet ((,) (Chi ch prd (Left nt :: Either NT T)) attr ': cs), WrapField (ChiReco prd) attr ~ Attribution attr) => Use' True att prd nts a ((,) (Chi ch prd (Left nt :: Either NT T)) attr ': cs) Source # | |
class Use (att :: Att) (prd :: Prod) (nts :: [NT]) (a :: Type) sc where Source #
usechi :: Label att -> Label prd -> KList nts -> (a -> a -> a) -> ChAttsRec prd sc -> Maybe a Source #
class Empties (fc :: [(Child, Type)]) (prd :: Prod) where Source #
Instances
Empties ([] :: [(Child, Type)]) prd Source # | |
(Empties fcr prd, chi ~ Chi ch prd nt, LabelSet ((,) chi ([] :: [(Att, Type)]) ': EmptiesR fcr)) => Empties ((,) chi (Attribution e -> Attribution a) ': fcr) prd Source # | |
Defined in Language.Grammars.AspectAG type EmptiesR ((chi, Attribution e -> Attribution a) ': fcr) :: [(Child, [(Att, Type)])] Source # empties :: Record ((chi, Attribution e -> Attribution a) ': fcr) -> ChAttsRec prd (EmptiesR ((chi, Attribution e -> Attribution a) ': fcr)) Source # |
class Kn (fcr :: [(Child, Type)]) (prd :: Prod) where Source #
Instances
Kn ([] :: [(Child, Type)]) prod Source # | |
(lch ~ Chi l prd nt, Kn fc prd, LabelSet ((,) lch sch ': SCh fc), LabelSet ((,) lch ich ': ICh fc)) => Kn ((,) lch (Attribution ich -> Attribution sch) ': fc) prd Source # | |
Defined in Language.Grammars.AspectAG type ICh ((lch, Attribution ich -> Attribution sch) ': fc) :: [(Child, [(Att, Type)])] Source # type SCh ((lch, Attribution ich -> Attribution sch) ': fc) :: [(Child, [(Att, Type)])] Source # kn :: Record ((lch, Attribution ich -> Attribution sch) ': fc) -> ChAttsRec prd (ICh ((lch, Attribution ich -> Attribution sch) ': fc)) -> ChAttsRec prd (SCh ((lch, Attribution ich -> Attribution sch) ': fc)) Source # |
class At pos att m where Source #
Instances
(RequireR (OpLookup (ChiReco prd) (Chi ch prd nt) chi) ctx (Attribution r), RequireR (OpLookup AttReco (Att att t) r) ctx t', RequireEq prd prd' ctx, RequireEq t t' ctx, RequireEq (Chi ch prd nt) (Chi ch prd (Left (NT n) :: Either NT T)) ctx) => At (Chi ch prd nt :: Child) (Att att t :: Att) (Reader (Proxy ctx, Fam prd' chi par)) Source # | |
Defined in Language.Grammars.AspectAG | |
(RequireR (OpLookup AttReco (Att att t) par) ctx t', RequireEq t t' ctx) => At Lhs (Att att t :: Att) (Reader (Proxy ctx, Fam prd chi par)) Source # | |
data OpComRA' (b :: Bool) (ctx :: [ErrorMessage]) (prd :: Prod) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (ic :: [(Child, [(Att, Type)])]) (sp :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sp' :: [(Att, Type)]) (a :: [(Prod, Type)]) where Source #
OpComRA' :: Proxy b -> CRule ctx prd sc ip ic sp ic' sp' -> Aspect a -> OpComRA' b ctx prd sc ip ic sp ic' sp' a |
Instances
Require (OpExtend PrdReco prd (CRule ctx prd sc ip ic sp ic' sp') a) ctx => Require (OpComRA' False ctx prd sc ip ic sp ic' sp' a) ctx Source # | |
(Require (OpUpdate PrdReco prd (CRule ctx prd sc ip ic sp ic'' sp'') a) ctx, RequireR (OpLookup PrdReco prd a) ctx (CRule ctx prd sc ip ic sp ic' sp'), IC (ReqR (OpLookup PrdReco prd a)) ~ ic, SP (ReqR (OpLookup PrdReco prd a)) ~ sp) => Require (OpComRA' True ctx prd sc ip ic' sp' ic'' sp'' a) ctx Source # | |
type ReqR (OpComRA' False ctx prd sc ip ic sp ic' sp' a) Source # | |
type ReqR (OpComRA' True ctx prd sc ip ic' sp' ic'' sp'' a) Source # | |
data OpComRA (ctx :: [ErrorMessage]) (prd :: Prod) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (ic :: [(Child, [(Att, Type)])]) (sp :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sp' :: [(Att, Type)]) (a :: [(Prod, Type)]) where Source #
data OpComAsp (al :: [(Prod, Type)]) (ar :: [(Prod, Type)]) where Source #
Instances
(RequireR (OpComAsp al ar) ctx (Aspect ar'), Require (OpComRA ctx prd sc ip ic sp ic' sp' ar') ctx) => Require (OpComAsp al ((,) prd (CRule ctx prd sc ip ic sp ic' sp') ': ar)) ctx Source # | |
Require (OpComAsp al ([] :: [(Prod, Type)])) ctx Source # | |
type ReqR (OpComAsp al ([] :: [(Prod, Type)])) Source # | |
type ReqR (OpComAsp al ((,) prd (CRule ctx prd sc ip ic sp ic' sp') ': ar)) Source # | |
class MapCtxAsp (r :: [(Prod, Type)]) (ctx :: [ErrorMessage]) (ctx' :: [ErrorMessage]) where Source #
newtype CRule (ctx :: [ErrorMessage]) prd sc ip ic sp ic' sp' Source #
Rules with context.
Instances
(RequireR (OpComAsp al ar) ctx (Aspect ar'), Require (OpComRA ctx prd sc ip ic sp ic' sp' ar') ctx) => Require (OpComAsp al ((,) prd (CRule ctx prd sc ip ic sp ic' sp') ': ar)) ctx Source # | |
(MapCtxAsp r ctx ctx', ResMapCtx r ctx ctx' ~ r', LabelSetF ((,) l (CRule ctx prd sc ip ic sp ic' sp') ': r') ~ True) => MapCtxAsp ((,) l (CRule ctx' prd sc ip ic sp ic' sp') ': r) ctx ctx' Source # | |
Defined in Language.Grammars.AspectAG | |
type ReqR (OpComAsp al ((,) prd (CRule ctx prd sc ip ic sp ic' sp') ': ar)) Source # | |
type ResMapCtx ((,) l (CRule ctx' prd sc ip ic sp ic' sp') ': r) ctx ctx' Source # | |
type Rule (prd :: Prod) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (ic :: [(Child, [(Att, Type)])]) (sp :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sp' :: [(Att, Type)]) = Fam prd sc ip -> Fam prd ic sp -> Fam prd ic' sp' Source #
Rules are a function from the input family to the output family. They are indexed by a production.
data Fam (prd :: Prod) (c :: [(Child, [(Att, Type)])]) (p :: [(Att, Type)]) :: Type where Source #
In each node of the grammar, the Fam contains a single attribution for the parent, and a collection (Record) of attributions for the children:
Fam :: ChAttsRec prd c -> Attribution p -> Fam prd c p |
Instances
(RequireR (OpLookup (ChiReco prd) (Chi ch prd nt) chi) ctx (Attribution r), RequireR (OpLookup AttReco (Att att t) r) ctx t', RequireEq prd prd' ctx, RequireEq t t' ctx, RequireEq (Chi ch prd nt) (Chi ch prd (Left (NT n) :: Either NT T)) ctx) => At (Chi ch prd nt :: Child) (Att att t :: Att) (Reader (Proxy ctx, Fam prd' chi par)) Source # | |
Defined in Language.Grammars.AspectAG | |
(RequireR (OpLookup AttReco (Att att t) par) ctx t', RequireEq t t' ctx) => At Lhs (Att att t :: Att) (Reader (Proxy ctx, Fam prd chi par)) Source # | |
type ResAt (Chi ch prd nt :: Child) (Att att t :: Att) (Reader (Proxy ctx, Fam prd' chi par)) Source # | |
type ResAt Lhs (Att att t :: Att) (Reader (Proxy ctx, Fam prd chi par)) Source # | |
sem_Lit :: a -> Attribution ('[] :: [(Att, Type)]) -> Attribution '['(Att "term" a, a)] Source #
Instances
SemLit a Source # | |
Defined in Language.Grammars.AspectAG |
par :: Fam prd c p -> Attribution p Source #
emptyAspect :: CAspect ctx '[] Source #
Empty Aspect.
comAspect :: (Require (OpComAsp al ar) ctx, ReqR (OpComAsp al ar) ~ Aspect asp) => CAspect ctx al -> CAspect ctx ar -> CAspect ctx asp Source #
combination of Aspects
traceAspect :: MapCtxAsp r ctx ((Text "aspect " :<>: e) ': ctx) => Proxy e -> CAspect ((Text "aspect " :<>: e) ': ctx) r -> CAspect ctx (ResMapCtx r ctx ((Text "aspect " :<>: e) ': ctx)) Source #
|traceAspect| adds context to an aspect.
traceRule :: Proxy e -> CRule ((Text "rule " :<>: e) ': ctx) prd sc ip ic sp ic' sp' -> CRule ctx prd sc ip ic sp ic' sp' Source #
mapCRule :: (Proxy ctx -> Proxy ctx') -> CRule ctx' prd sc ip ic sp ic' sp' -> CRule ctx prd sc ip ic sp ic' sp' Source #
mapCAspect :: MapCtxAsp r ctx1 ctx2 => (Proxy ctx1 -> Proxy ctx2) -> CAspect ctx2 r -> CAspect ctx1 (ResMapCtx r ctx1 ctx2) Source #
extAspect :: RequireR (OpComRA ctx prd sc ip ic sp ic' sp' a) ctx (Aspect asp) => CRule ctx prd sc ip ic sp ic' sp' -> CAspect ctx a -> CAspect ctx asp Source #
(.+:) :: (Require (OpComRA' (HasLabel prd a) ctx prd sc ip ic sp ic' sp' a) ctx, ReqR (OpComRA' (HasLabel prd a) ctx prd sc ip ic sp ic' sp' a) ~# Rec PrdReco asp) => CRule ctx prd sc ip ic sp ic' sp' -> CAspect ctx a -> CAspect ctx asp infixr 3 Source #
(.:+.) :: (Require (OpComRA' (HasLabel prd a) ctx prd sc ip ic sp ic' sp' a) ctx, ReqR (OpComRA' (HasLabel prd a) ctx prd sc ip ic sp ic' sp' a) ~# Rec PrdReco asp) => CAspect ctx a -> CRule ctx prd sc ip ic sp ic' sp' -> CAspect ctx asp infixl 3 Source #
(.:+:) :: (Require (OpComAsp al ar) ctx, ReqR (OpComAsp al ar) ~# Rec PrdReco asp) => CAspect ctx al -> CAspect ctx ar -> CAspect ctx asp infixr 4 Source #
syndef :: (RequireEq t t' ctx', RequireR (OpExtend AttReco (Att att t) t sp) ctx (Attribution sp'), ctx' ~ (((((Text "syndef(" :<>: ShowT (Att att t)) :<>: Text ", ") :<>: ShowT prd) :<>: Text ")") ': ctx)) => Label (Att att t) -> Label prd -> (Proxy ctx' -> Fam prd sc ip -> t') -> CRule ctx prd sc ip ic sp ic sp' Source #
syndefM :: (RequireEq t t' ctx', RequireR (OpExtend AttReco (Att att t) t sp) ctx (Attribution sp'), ctx' ~ (((((Text "syndef(" :<>: ShowT (Att att t)) :<>: Text ", ") :<>: ShowT prd) :<>: Text ")") ': ctx)) => Label (Att att t) -> Label prd -> Reader (Proxy ctx', Fam prd sc ip) t' -> CRule ctx prd sc ip ic sp ic sp' Source #
syn :: (Require (OpExtend' (LabelSetF ((,) (Att att t') t' ': sp)) AttReco (Att att t') t' sp) ctx, ReqR (OpExtend' (LabelSetF ((,) (Att att t') t' ': sp)) AttReco (Att att t') t' sp) ~# Rec AttReco sp') => Label (Att att t') -> Label prd -> Reader (Proxy (((((Text "syndef(" :<>: (((Text "Attribute " :<>: Text att) :<>: Text ":") :<>: ShowType t')) :<>: Text ", ") :<>: ShowT prd) :<>: Text ")") ': ctx), Fam prd sc ip) t' -> CRule ctx prd sc ip ic sp ic sp' Source #
inh :: (Require (OpExtend' (LabelSetF ((,) (Att att t') t' ': r)) AttReco (Att att t') t' r) ctx, Require (OpUpdate (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) (Left n :: Either NT T)) v2 ic) ctx, Require (OpLookup (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) (Left n :: Either NT T)) ic) ctx, ReqR (OpLookup (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) (Left n :: Either NT T)) ic) ~# Rec AttReco r, ReqR (OpExtend' (LabelSetF ((,) (Att att t') t' ': r)) AttReco (Att att t') t' r) ~# Rec AttReco v2, ReqR (OpUpdate (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) (Left n :: Either NT T)) v2 ic) ~# Rec (ChiReco (Prd prd nt)) ic') => Label (Att att t') -> Label (Prd prd nt) -> Label (Chi chi (Prd prd nt) (Left n :: Either NT T)) -> Reader (Proxy (((((((Text "inhdef(" :<>: (((Text "Attribute " :<>: Text att) :<>: Text ":") :<>: ShowType t')) :<>: Text ", ") :<>: ((ShowT nt :<>: Text "::Production ") :<>: Text prd)) :<>: Text ", ") :<>: ((((((ShowT nt :<>: Text "::Production ") :<>: Text prd) :<>: Text "::Child ") :<>: Text chi) :<>: Text ":") :<>: ShowT n)) :<>: Text ")") ': ctx), Fam (Prd prd nt) sc ip) t' -> CRule ctx (Prd prd nt) sc ip ic sp ic' sp Source #
synmod :: RequireR (OpUpdate AttReco (Att att t) t r) ctx (Attribution sp') => Label (Att att t) -> Label prd -> (Proxy (((((Text "synmod(" :<>: ShowT (Att att t)) :<>: Text ", ") :<>: ShowT prd) :<>: Text ")") ': ctx) -> Fam prd sc ip -> t) -> CRule ctx prd sc ip ic' r ic' sp' Source #
synmodM :: RequireR (OpUpdate AttReco (Att att t) t r) ctx (Attribution sp') => Label (Att att t) -> Label prd -> Reader (Proxy (((((Text "synmod(" :<>: ShowT (Att att t)) :<>: Text ", ") :<>: ShowT prd) :<>: Text ")") ': ctx), Fam prd sc ip) t -> CRule ctx prd sc ip ic' r ic' sp' Source #
inhdef :: (RequireEq t t' ctx', RequireR (OpExtend AttReco (Att att t) t r) ctx (Attribution v2), RequireR (OpUpdate (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) ntch) v2 ic) ctx (ChAttsRec (Prd prd nt) ic'), RequireR (OpLookup (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) ntch) ic) ctx (Attribution r), RequireEq ntch (Left n) ctx', ctx' ~ (((((((Text "inhdef(" :<>: ShowT (Att att t)) :<>: Text ", ") :<>: ShowT (Prd prd nt)) :<>: Text ", ") :<>: ShowT (Chi chi (Prd prd nt) ntch)) :<>: Text ")") ': ctx)) => Label (Att att t) -> Label (Prd prd nt) -> Label (Chi chi (Prd prd nt) ntch) -> (Proxy ctx' -> Fam (Prd prd nt) sc ip -> t') -> CRule ctx (Prd prd nt) sc ip ic sp ic' sp Source #
inhdefM :: (RequireEq t t' ctx', RequireR (OpExtend' (LabelSetF ('(Att att t, t) ': r)) AttReco (Att att t) t r) ctx (Attribution v2), RequireR (OpUpdate (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) ntch) v2 ic) ctx (ChAttsRec (Prd prd nt) ic'), RequireR (OpLookup (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) ntch) ic) ctx (Attribution r), RequireEq ntch (Left n) ctx', ctx' ~ (((((((Text "inhdef(" :<>: ShowT (Att att t')) :<>: Text ", ") :<>: ShowT (Prd prd nt)) :<>: Text ", ") :<>: ShowT (Chi chi (Prd prd nt) ntch)) :<>: Text ")") ': ctx)) => Label (Att att t) -> Label (Prd prd nt) -> Label (Chi chi (Prd prd nt) ntch) -> Reader (Proxy ctx', Fam (Prd prd nt) sc ip) t' -> CRule ctx (Prd prd nt) sc ip ic sp ic' sp Source #
inhmod :: (RequireEq t t' ctx', RequireR (OpUpdate AttReco (Att att t) t r) ctx (Attribution v2), RequireR (OpUpdate (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) ntch) v2 ic) ctx (ChAttsRec (Prd prd nt) ic'), RequireR (OpLookup (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) ntch) ic) ctx (Attribution r), RequireEq ntch (Left n) ctx', ctx' ~ (((((((Text "inhmod(" :<>: ShowT (Att att t)) :<>: Text ", ") :<>: ShowT (Prd prd nt)) :<>: Text ", ") :<>: ShowT (Chi chi (Prd prd nt) ntch)) :<>: Text ")") ': ctx)) => Label (Att att t) -> Label (Prd prd nt) -> Label (Chi chi (Prd prd nt) ntch) -> (Proxy ctx' -> Fam (Prd prd nt) sc ip -> t') -> CRule ctx (Prd prd nt) sc ip ic sp ic' sp Source #
inhmodM :: (RequireEq t t' ctx', RequireR (OpUpdate AttReco (Att att t) t r) ctx (Attribution v2), RequireR (OpUpdate (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) ntch) v2 ic) ctx (ChAttsRec (Prd prd nt) ic'), RequireR (OpLookup (ChiReco (Prd prd nt)) (Chi chi (Prd prd nt) ntch) ic) ctx (Attribution r), RequireEq ntch (Left n) ctx', ctx' ~ (((((((Text "inhmod(" :<>: ShowT (Att att t)) :<>: Text ", ") :<>: ShowT (Prd prd nt)) :<>: Text ", ") :<>: ShowT (Chi chi (Prd prd nt) ntch)) :<>: Text ")") ': ctx)) => Label (Att att t) -> Label (Prd prd nt) -> Label (Chi chi (Prd prd nt) ntch) -> Reader (Proxy ctx', Fam (Prd prd nt) sc ip) t' -> CRule ctx (Prd prd nt) sc ip ic sp ic' sp Source #
ext' :: CRule ctx prd sc ip ic sp ic' sp' -> CRule ctx prd sc ip a b ic sp -> CRule ctx prd sc ip a b ic' sp' Source #
ext :: RequireEq prd prd' (Text "ext" ': ctx) => CRule ctx prd sc ip ic sp ic' sp' -> CRule ctx prd' sc ip a b ic sp -> CRule ctx prd sc ip a b ic' sp' Source #
(.+.) :: CRule ctx prd' sc ip ic sp ic' sp' -> CRule ctx prd' sc ip a b ic sp -> CRule ctx prd' sc ip a b ic' sp' infixr 6 Source #
ter :: (RequireR (OpLookup (ChiReco prd) pos chi) ctx (Attribution r), RequireR (OpLookup AttReco (Att "term" t) r) ctx t', RequireEq prd prd' ctx, RequireEq t t' ctx, RequireEq pos (Chi ch prd (Right (T t))) ctx, m ~ Reader (Proxy ctx, Fam prd' chi par)) => Label pos -> m (ResAt pos (Att "term" t) m) Source #
knit' :: (Kn fc prd, Empties fc prd) => CRule '[] prd (SCh fc) ip (EmptiesR fc) '[] (ICh fc) sp -> Record fc -> Attribution ip -> Attribution sp Source #
knit :: (Empties fc prd, Kn fc prd) => Proxy ctx -> CRule ctx prd (SCh fc) ip (EmptiesR fc) ([] :: [(Att, Type)]) (ICh fc) sp -> Record fc -> Attribution ip -> Attribution sp Source #
knitAspect :: (Empties fc prd1, Kn fc prd1, Require (OpLookup PrdReco prd2 r) ((Text "knit" :<>: ShowT prd2) ': ([] :: [ErrorMessage])), ReqR (OpLookup PrdReco prd2 r) ~# CRule ([] :: [ErrorMessage]) prd1 (SCh fc) ip (EmptiesR fc) ([] :: [(Att, Type)]) (ICh fc) sp) => Label prd2 -> CAspect ([] :: [ErrorMessage]) r -> Record fc -> Attribution ip -> Attribution sp Source #
use :: (Require (OpExtend' (LabelSetF ((,) (Att att t') t' ': sp)) AttReco (Att att t') t' sp) ctx, Use (Att att t') prd nts t' sc, ReqR (OpExtend' (LabelSetF ((,) (Att att t') t' ': sp)) AttReco (Att att t') t' sp) ~# Rec AttReco sp') => Label (Att att t') -> Label prd -> KList nts -> (t' -> t' -> t') -> t' -> CAspect ctx ((,) prd (CRule ctx prd sc ip ic' sp ic' sp') ': ([] :: [(Prod, Type)])) Source #