mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
Use _cat category as root in SRGS ABNF and JSGF. SRGS XML already did this.
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -60,7 +60,9 @@ prABNF sisr probs srg@(SRG{grammarName=name,grammarLanguage=ml,
|
||||
language = maybe empty (\l -> text "language" <+> text l <> char ';') ml
|
||||
tagFormat | isJust sisr = text "tag-format" <+> text "<semantics/1.0>" <> char ';'
|
||||
| otherwise = empty
|
||||
mainCat = text "root" <+> prCat start <> char ';'
|
||||
mainCat = case cfgCatToGFCat origStart of
|
||||
Just c -> text "root" <+> prCat (catFormId c) <> char ';'
|
||||
Nothing -> empty
|
||||
prRule (SRGRule cat origCat rhs) =
|
||||
comment origCat $$
|
||||
rule False cat (map prAlt (ebnfSRGAlts rhs))
|
||||
|
||||
Reference in New Issue
Block a user