1
0
forked from GitHub/gf-core

Use _cat category as root in SRGS ABNF and JSGF. SRGS XML already did this.

This commit is contained in:
bringert
2007-01-21 17:10:10 +00:00
parent a9dfb0e477
commit b768aa780f
2 changed files with 6 additions and 2 deletions

View File

@@ -55,7 +55,9 @@ prJSGF sisr srg@(SRG{grammarName=name,grammarLanguage=ml,
text ("grammar " ++ name ++ ";")
lang = maybe empty text ml
mainCat = comment ("Start category: " ++ origStart) $$
rule True "MAIN" [prCat start]
case cfgCatToGFCat origStart of
Just c -> rule True "MAIN" [prCat (catFormId c)]
Nothing -> empty
prRule (SRGRule cat origCat rhs) =
comment origCat $$
rule False cat (map prAlt (ebnfSRGAlts rhs))