-
Notifications
You must be signed in to change notification settings - Fork 0
/
grammar.ebnf
99 lines (81 loc) · 4.3 KB
/
grammar.ebnf
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
97
98
99
unichar = <any Unicode code point>
unistring = *unichar
; defined in RFC 5234
ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
DIGIT = %x30-39 ; 0-9
HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
; defined in RFC 3986
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
pct-encoded = "%" HEXDIG HEXDIG
sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
fragment = *( pchar / "/" / "?" )
; defined in RFC 2326
npt-sec = 1*DIGIT [ "." *DIGIT ] ; definitions taken
npt-hhmmss = npt-hh ":" npt-mm ":" npt-ss [ "." *DIGIT] ; from RFC 2326
npt-mmss = npt-mm ":" npt-ss [ "." *DIGIT]
npt-hh = 1*DIGIT ; any positive number
npt-mm = 2DIGIT ; 0-59
npt-ss = 2DIGIT ; 0-59
; defined in RFC 3339
date-fullyear = 4DIGIT
date-month = 2DIGIT ; 01-12
date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on
; month/year
time-hour = 2DIGIT ; 00-23
time-minute = 2DIGIT ; 00-59
time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second
; rules
time-secfrac = "." 1*DIGIT
time-numoffset = ("+" / "-") time-hour ":" time-minute
time-offset = "Z" / time-numoffset
partial-time = time-hour ":" time-minute ":" time-second
[time-secfrac]
full-date = date-fullyear "-" date-month "-" date-mday
full-time = partial-time time-offset
date-time = full-date "T" full-time
; Mediafragment definitions
segment = mediasegment / *( pchar / "/" / "?" ) ; augmented fragment
; definition taken from
; RFC 3986
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Common Prefixes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
deftimeformat = %x6E.70.74 ; "npt"
pfxdeftimeformat = %x74.3A.6E.70.74 ; "t:npt"
smpteformat = %x73.6D.70.74.65 ; "smpte"
/ %x73.6D.70.74.65.2D.32.35 ; "smpte-25"
/ %x73.6D.70.74.65.2D.33.30 ; "smpte-30"
/ %x73.6D.70.74.65.2D.33.30.2D.64.72.6F.70 ; "smpte-30-drop"
pfxsmpteformat = %x74.3A.73.6D.70.74.65 ; "t:smpte"
/ %x74.3A.73.6D.70.74.65.2D.32.35 ; "t:smpte-25"
/ %x74.3A.73.6D.70.74.65.2D.33.30 ; "t:smpte-30"
/ %x74.3A.73.6D.70.74.65.2D.33.30.2D.64.72.6F.70 ; "t:smpte-30-drop"
clockformat = %x63.6C.6F.63.6B ; "clock"
pfxclockformat = %x74.3A.63.6C.6F.63.6B ; "clock"
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Media Segment ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
mediasegment = ( timesegment / spacesegment / tracksegment / idsegment )
*( "&" ( timesegment / spacesegment / tracksegment / idsegment )
timesegment = timeprefix "=" timeparam
timeprefix = %x74 ; "t"
timeparam = npttimedef / smptetimedef / clocktimedef
npttimedef = [ deftimeformat ":"] ( npttime [ "," npttime ] ) / ( "," npttime )
npttime = npt-sec / npt-mmss / npt-hhmmss
smptetimedef = smpteformat ":"( frametime [ "," frametime ] ) / ( "," frametime )
frametime = 1*DIGIT ":" 2DIGIT ":" 2DIGIT [ ":" 2DIGIT [ "." 2DIGIT ] ]
clocktimedef = clockformat ":"( clocktime [ "," clocktime ] ) / ( "," clocktime )
clocktime = (datetime / walltime / date)
datetime = date-time ; inclusion of RFC 3339
spacesegment = xywhprefix "=" xywhparam
xywhprefix = %x78.79.77.68 ; "xywh"
xywhparam = [ xywhunit ":" ] 1*DIGIT "," 1*DIGIT "," 1*DIGIT "," 1*DIGIT
xywhunit = %x70.69.78.65.6C ; "pixel"
/ %x70.65.72.63.65.6E.74 ; "percent"
tracksegment = trackprefix "=" trackparam
trackprefix = %x74.72.61.63.6B ; "track"
trackparam = unistring
idsegment = idprefix "=" idparam
idprefix = %x69.64 ; "id"
idparam = unistring