monotone

monotone Mtn Source Tree

Root/selectors.g

1grammar selectors;
2
3options {
4 language = C;
5}
6
7input : sequence EOF;
8
9sequence : addition ( ',' addition )*;
10
11addition : intersection ( ('+'|'~') intersection )*;
12
13intersection : antique ( ('^'|'&') antique )*;
14
15antique : selector ( '/' selector )*; // 'antique' (c) Richard Levitte
16
17selector :
18 immediate
19| '(' sequence ')'
20| function1 '(' sequence ')'
21;
22
23immediate :
24 Identifier
25| branchName
26| authorName
27;
28
29function1 :
30 'eca'
31| 'lca'
32| 'parents' | 'p'
33| 'ancestors' | 'anc' | 'a'
34| 'union' | 'difference' | 'intersection'
35;
36
37Identifier : 'i:' ('0'..'9'|'a'..'f'|'A'..'F')+;
38
39branchName : 'b:' anyString;
40
41authorName : 'a:' anyString;
42
43anyString : StringLiteral | StringQuoted | Globish | PCRE;
44
45StringLiteral : ('a'..'z'|'0'..'9'|'-'|'_'|'.'|'@')+;
46StringQuoted : '"' (~('"'|'\\')|'\\' .)+ '"';
47Globish : '<' (~('>'|'\\')|'\\' .)+ '>';
48PCRE : '#' (~('#'|'\\')|'\\' .)+ '#';

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status