summaryrefslogtreecommitdiff
path: root/src/GF/CFGM/CFG.cf
blob: af55d6401840b1cb71a1c24007370878d0eb8696 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
entrypoints Grammars;

Grammars. Grammars ::= [Grammar];

Grammar. Grammar ::= "grammar" Ident [Flag] [Rule] "end" "grammar";
separator Grammar "";

StartCat. Flag ::= "startcat" Category;
terminator Flag ";";

Rule. Rule ::= Fun ":" Profile "." Category "->" [Symbol];
terminator Rule ";";

Cons. Fun ::= Ident ;
Coerce. Fun ::= "_" ;

Profile. Profile ::= "[" [Ints] "]";

Ints. Ints ::= "[" [Integer] "]";
separator Ints ",";
separator Integer ",";

CatS. Symbol ::= Category;
TermS. Symbol ::= String;

-- separator Symbol "";
[]. [Symbol] ::= "." ;
(:[]). [Symbol] ::= Symbol ;
(:). [Symbol] ::= Symbol [Symbol] ;

Category. Category ::= SingleQuoteString ;

token SingleQuoteString '\'' ((char - ["'\\"]) | ('\\' ["'\\"]))* '\'' ;