mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-13 06:49:31 -06:00
37 lines
793 B
CFEngine3
37 lines
793 B
CFEngine3
entrypoints Grammars;
|
|
|
|
Grammars. Grammars ::= [Grammar];
|
|
|
|
Grammar. Grammar ::= "grammar" Ident [Flag] [Rule] "end" "grammar";
|
|
separator Grammar "";
|
|
|
|
StartCat. Flag ::= "startcat" Category;
|
|
terminator Flag ";";
|
|
|
|
Rule. Rule ::= Fun ":" Profiles "." Category "->" [Symbol];
|
|
terminator Rule ";";
|
|
|
|
Cons. Fun ::= Ident ;
|
|
Coerce. Fun ::= "_" ;
|
|
|
|
Profiles. Profiles ::= "[" [Profile] "]";
|
|
|
|
separator Profile ",";
|
|
|
|
UnifyProfile. Profile ::= "[" [Integer] "]";
|
|
ConstProfile. Profile ::= Ident ;
|
|
|
|
separator Integer ",";
|
|
|
|
CatS. Symbol ::= Category;
|
|
TermS. Symbol ::= String;
|
|
|
|
-- separator Symbol "";
|
|
[]. [Symbol] ::= "." ;
|
|
(:[]). [Symbol] ::= Symbol ;
|
|
(:). [Symbol] ::= Symbol [Symbol] ;
|
|
|
|
Category. Category ::= SingleQuoteString ;
|
|
|
|
token SingleQuoteString '\'' ((char - ["'\\"]) | ('\\' ["'\\"]))* '\'' ;
|