• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1cddl = S 1*(rule S)
2rule = typename [genericparm] S assignt S type
3     / groupname [genericparm] S assigng S grpent
4
5typename = id
6groupname = id
7
8assignt = "=" / "/="
9assigng = "=" / "//="
10
11genericparm = "<" S id S *("," S id S ) ">"
12genericarg = "<" S type1 S *("," S type1 S ) ">"
13
14type = type1 *(S "/" S type1)
15
16type1 = type2 [S (rangeop / ctlop) S type2]
17
18type2 = value
19      / typename [genericarg]
20      / "(" S type S ")"
21      / "{" S group S "}"
22      / "[" S group S "]"
23      / "~" S typename [genericarg]
24      / "&" S "(" S group S ")"
25      / "&" S groupname [genericarg]
26      / "#" "6" ["." uint] "(" S type S ")" ; note no space!
27      / "#" DIGIT ["." uint]                ; major/ai
28      / "#"                                 ; any
29
30rangeop = "..." / ".."
31
32ctlop = "." id
33
34group = grpchoice *(S "//" S grpchoice)
35
36grpchoice = *(grpent optcom)
37
38grpent = [occur S] [memberkey S] type
39       / [occur S] groupname [genericarg]  ; preempted by above
40       / [occur S] "(" S group S ")"
41
42memberkey = type1 S ["^" S] "=>"
43          / bareword S ":"
44          / value S ":"
45
46bareword = id
47
48optcom = S ["," S]
49
50occur = [uint] "*" [uint]
51      / "+"
52      / "?"
53
54uint = DIGIT1 *DIGIT
55     / "0x" 1*HEXDIG
56     / "0b" 1*BINDIG
57     / "0"
58
59value = number
60      / text
61      / bytes
62
63int = ["-"] uint
64
65; This is a float if it has fraction or exponent; int otherwise
66number = hexfloat / (int ["." fraction] ["e" exponent ])
67hexfloat = "0x" 1*HEXDIG ["." 1*HEXDIG] "p" exponent
68fraction = 1*DIGIT
69exponent = ["+"/"-"] 1*DIGIT
70
71text = %x22 *SCHAR %x22
72SCHAR = %x20-21 / %x23-5B / %x5D-10FFFD / SESC
73SESC = "\" %x20-10FFFD
74
75bytes = [bsqual] %x27 *BCHAR %x27
76BCHAR = %x20-26 / %x28-5B / %x5D-10FFFD / SESC / CRLF
77bsqual = "h" / "b64"
78
79id = EALPHA *(*("-" / ".") (EALPHA / DIGIT))
80ALPHA = %x41-5A / %x61-7A
81EALPHA = ALPHA / "@" / "_" / "$"
82DIGIT = %x30-39
83DIGIT1 = %x31-39
84HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
85BINDIG = %x30-31
86
87S = *WS
88WS = SP / NL
89SP = %x20
90NL = COMMENT / CRLF
91COMMENT = ";" *PCHAR CRLF
92PCHAR = %x20-10FFFD
93CRLF = %x0A / %x0D.0A
94