forked from GitHub/gf-core
Added CFGM format (pm -printer=cfgm) and utf8 conversion for pm.
This commit is contained in:
35
src/GF/CFGM/CFG.cf
Normal file
35
src/GF/CFGM/CFG.cf
Normal file
@@ -0,0 +1,35 @@
|
||||
entrypoints Grammars;
|
||||
|
||||
Grammars. Grammars ::= [Grammar];
|
||||
|
||||
Grammar. Grammar ::= "grammar" Ident [Flag] [Rule] "end" "grammar";
|
||||
separator Grammar "";
|
||||
|
||||
StartCat. Flag ::= "startcat" Category;
|
||||
terminator Flag ";";
|
||||
|
||||
Rule. Rule ::= Ident ":" Name Profile "." Category "->" [Symbol];
|
||||
terminator Rule ";";
|
||||
|
||||
Profile. Profile ::= "[" [Ints] "]";
|
||||
|
||||
Ints. Ints ::= "[" [Integer] "]";
|
||||
separator Ints ",";
|
||||
separator Integer ",";
|
||||
|
||||
CatS. Symbol ::= Category;
|
||||
TermS. Symbol ::= String;
|
||||
|
||||
separator Symbol "";
|
||||
|
||||
Name. Name ::= [IdentParam] Category;
|
||||
terminator IdentParam "/";
|
||||
|
||||
Category. Category ::= IdentParam "." Ident [Param] ;
|
||||
|
||||
IdentParam. IdentParam ::= Ident "{" [Param] "}" ;
|
||||
|
||||
Param. Param ::= "!" Ident ;
|
||||
separator Param "";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user