forked from GitHub/gf-core
Handle coercion functions (_) in CFG generation for SRG.
This commit is contained in:
@@ -75,9 +75,11 @@ cfgToCFRules s =
|
|||||||
symb = mapSymbol catToString id
|
symb = mapSymbol catToString id
|
||||||
catToString = prt
|
catToString = prt
|
||||||
gfcc = stateGFCC s
|
gfcc = stateGFCC s
|
||||||
nameToTerm (Name f prs) = CFObj f (zipWith profileToTerm args prs)
|
nameToTerm (Name IW [Unify [n]]) = CFRes n
|
||||||
where C.Typ args _ = lookType gfcc (i2i f)
|
nameToTerm (Name f@(IC c) prs) =
|
||||||
i2i (IC c) = C.CId c
|
CFObj f (zipWith profileToTerm args prs)
|
||||||
|
where C.Typ args _ = lookType gfcc (C.CId c)
|
||||||
|
nameToTerm n = error $ "cfgToCFRules.nameToTerm" ++ show n
|
||||||
profileToTerm (C.CId t) (Unify []) = CFMeta t
|
profileToTerm (C.CId t) (Unify []) = CFMeta t
|
||||||
profileToTerm _ (Unify xs) = CFRes (last xs) -- FIXME: unify
|
profileToTerm _ (Unify xs) = CFRes (last xs) -- FIXME: unify
|
||||||
profileToTerm (C.CId t) (Constant f) = maybe (CFMeta t) (\x -> CFObj x []) (forestName f)
|
profileToTerm (C.CId t) (Constant f) = maybe (CFMeta t) (\x -> CFObj x []) (forestName f)
|
||||||
|
|||||||
Reference in New Issue
Block a user