1
0
forked from GitHub/gf-core

Use ENBF to generate SRGS.

This commit is contained in:
bringert
2007-01-07 23:58:41 +00:00
parent a4aec2da49
commit 3e9d2b4a2f
2 changed files with 23 additions and 14 deletions

View File

@@ -58,7 +58,7 @@ prJSGF sisr srg@(SRG{grammarName=name,startCat=start,origStartCat=origStart,rule
rule False cat (map prAlt (ebnfSRGAlts rhs))
-- rule False cat (map prAlt rhs)
-- FIXME: use the probability
prAlt (EBnfSRGAlt mp n rhs) = sep [initTag, prItem sisr n rhs, finalTag]
prAlt (EBnfSRGAlt mp n rhs) = sep [initTag, parens (prItem sisr n rhs), finalTag]
-- prAlt (SRGAlt mp n rhs) = initTag <+> prItem sisr n rhs <+> finalTag
where initTag | isEmpty t = empty
| otherwise = text "<NULL>" <+> t