-
Notifications
You must be signed in to change notification settings - Fork 1
/
grammar.txt
96 lines (70 loc) · 1.82 KB
/
grammar.txt
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
module-map-file:
module-declaration*
module-declaration:
'explicit'? 'framework'? 'module' module-id attributes? '{' module-member* '}'
'extern' 'module' module-id string-literal
module-id:
identifier ('.' identifier)*
module-member:
requires-declaration
header-declaration
umbrella-dir-declaration
submodule-declaration
export-declaration
export-as-declaration
use-declaration
link-declaration
config-macros-declaration
conflict-declaration
requires-declaration:
'requires' feature-list
feature-list:
feature (',' feature)*
feature:
'!'? identifier
header-declaration:
'private'? 'textual'? header string-literal header-attrs?
'umbrella' 'header' string-literal header-attrs?
'exclude' 'header' string-literal header-attrs?
header-attrs:
'{' header-attr* '}'
header-attr:
'size' integer-literal
'mtime' integer-literal
umbrella-dir-declaration:
'umbrella' string-literal
submodule-declaration:
module-declaration
inferred-submodule-declaration
inferred-submodule-declaration:
'explicit'? 'framework'? 'module' '*' attributes? '{' inferred-submodule-member* '}'
inferred-submodule-member:
'export' '*'
export-declaration:
'export' wildcard-module-id
wildcard-module-id:
identifier
'*'
identifier '.' wildcard-module-id
export-as-declaration:
'export_as' identifier
use-declaration:
'use' module-id
link-declaration:
'link' 'framework'? string-literal
config-macros-declaration:
'config_macros' attributes? config-macro-list?
config-macro-list:
identifier (',' identifier)*
conflict-declaration:
'conflict' module-id ',' string-literal
attributes:
attribute+
attribute:
'[' identifier ']'
identifier:
nondigit (nondigit | digit)*
nondigit:
[a-zA-Z_]
digit:
[0-9]