← Older edit
Newer edit →
1,754 bytes added
16:10, 25 September 2012
== OSD600 ==
Over the weekend, I wrote a set of about 31 conformance tests for a webvtt parser ([[https://github.com/downloads/caitp/webvtt/caitp-cue_settings_tests-09232012.tgz here]], more recent ones should be posted [OSD600/webvtt/cue_settings|here]).
This is a relatively simple section of the draft, as far as I can tell. It can be illustrated essentially like this (BNF, no state machine diagram here) -- regular expressions have been included in some areas, eg /[0-9]+/. I'm not including the BNF for the other cue-settings here, this is just a start. The main point is that BNF will be helpful for writing scanners and parsers.
<webvtt-delimiter> ::= U+0020
<webvtt-delimiters> ::= <webvtt-delimiter>
| <webvtt-delimiters> <webvtt-delimiter>
<vertical-value> ::= "rl"
<vertical-setting> ::= "vertical" ":" <vertical-value>
<line-value-pct> ::= /[0-9]+/ "%"
<line-value-num> ::= /[0-9]+/
| "-" /[0-9]+/
<line-value> ::= <line-value-pct>
<line-setting> ::= "line" ":" <line-value>
<cue-setting> ::= <vertical-setting>
<cue-settings> ::= <cue-setting>
| <cue-settings> <webvtt-delimiters> <cue-setting>
Some implementation details for the parser:
The spec allows for multiple cue-settings per line (as shown in the BNF), however, the same line setting may not be repeated twice, which would not be caught by a parser generator based on the BNF alone, and would have to be checked for in code.
Retrieved from "
SICT AR Meeting Area
get involved with CDOT
as a Student
as an Open Source Community Member
as a Company
Real World Mozilla
Course Project List
Potential Course Projects
View user groups
About CDOT Wiki