2017-06-19 00:17:56 +00:00
function HMML _parse ( contents ) {
var l = new HMMLexer ( ) ;
var state = {
line : 0 ,
annos : [ ] ,
2017-06-20 20:15:26 +00:00
meta : {
annotators : [ ] ,
guests : [ ] ,
co _hosts : [ ]
} ,
2017-06-19 00:17:56 +00:00
an : {
line : 0 ,
text : "" ,
references : [ ] ,
markers : [ ] ,
} ,
2017-06-19 17:23:17 +00:00
ref : { } ,
2017-06-19 00:17:56 +00:00
first : true
} ;
l . setInput ( contents , state ) ;
try {
var r ;
do {
r = l . next ( ) ;
} while ( ! r ) ;
return {
metadata : state . meta ,
annotations : state . annos
} ;
} catch ( e ) {
return {
2017-06-19 15:31:46 +00:00
error : e
2017-06-19 00:17:56 +00:00
} ;
}
}
function HMMLexer ( ) { }
/* generated by jison-lex 0.3.4 */
HMMLexer . prototype = {
EOF : 1 ,
parseError : function parseError ( str , hash ) {
if ( this . yy . parser ) {
this . yy . parser . parseError ( str , hash ) ;
} else {
throw new Error ( str ) ;
}
} ,
// resets the lexer, sets new input
setInput : function ( input , yy ) {
this . yy = yy || this . yy || { } ;
this . _input = input ;
this . _more = this . _backtrack = this . done = false ;
this . yylineno = this . yyleng = 0 ;
this . yytext = this . matched = this . match = '' ;
this . conditionStack = [ 'INITIAL' ] ;
this . yylloc = {
first _line : 1 ,
first _column : 0 ,
last _line : 1 ,
last _column : 0
} ;
if ( this . options . ranges ) {
this . yylloc . range = [ 0 , 0 ] ;
}
this . offset = 0 ;
return this ;
} ,
// consumes and returns one char from the input
input : function ( ) {
var ch = this . _input [ 0 ] ;
this . yytext += ch ;
this . yyleng ++ ;
this . offset ++ ;
this . match += ch ;
this . matched += ch ;
var lines = ch . match ( /(?:\r\n?|\n).*/g ) ;
if ( lines ) {
this . yylineno ++ ;
this . yylloc . last _line ++ ;
} else {
this . yylloc . last _column ++ ;
}
if ( this . options . ranges ) {
this . yylloc . range [ 1 ] ++ ;
}
this . _input = this . _input . slice ( 1 ) ;
return ch ;
} ,
// unshifts one char (or a string) into the input
unput : function ( ch ) {
var len = ch . length ;
var lines = ch . split ( /(?:\r\n?|\n)/g ) ;
this . _input = ch + this . _input ;
this . yytext = this . yytext . substr ( 0 , this . yytext . length - len ) ;
//this.yyleng -= len;
this . offset -= len ;
var oldLines = this . match . split ( /(?:\r\n?|\n)/g ) ;
this . match = this . match . substr ( 0 , this . match . length - 1 ) ;
this . matched = this . matched . substr ( 0 , this . matched . length - 1 ) ;
if ( lines . length - 1 ) {
this . yylineno -= lines . length - 1 ;
}
var r = this . yylloc . range ;
this . yylloc = {
first _line : this . yylloc . first _line ,
last _line : this . yylineno + 1 ,
first _column : this . yylloc . first _column ,
last _column : lines ?
( lines . length === oldLines . length ? this . yylloc . first _column : 0 ) +
oldLines [ oldLines . length - lines . length ] . length - lines [ 0 ] . length : this . yylloc . first _column - len
} ;
if ( this . options . ranges ) {
this . yylloc . range = [ r [ 0 ] , r [ 0 ] + this . yyleng - len ] ;
}
this . yyleng = this . yytext . length ;
return this ;
} ,
// When called from action, caches matched text and appends it on next action
more : function ( ) {
this . _more = true ;
return this ;
} ,
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
reject : function ( ) {
if ( this . options . backtrack _lexer ) {
this . _backtrack = true ;
} else {
return this . parseError ( 'Lexical error on line ' + ( this . yylineno + 1 ) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this . showPosition ( ) , {
text : "" ,
token : null ,
line : this . yylineno
} ) ;
}
return this ;
} ,
// retain first n characters of the match
less : function ( n ) {
this . unput ( this . match . slice ( n ) ) ;
} ,
// displays already matched input, i.e. for error messages
pastInput : function ( ) {
var past = this . matched . substr ( 0 , this . matched . length - this . match . length ) ;
return ( past . length > 20 ? '...' : '' ) + past . substr ( - 20 ) . replace ( /\n/g , "" ) ;
} ,
// displays upcoming input, i.e. for error messages
upcomingInput : function ( ) {
var next = this . match ;
if ( next . length < 20 ) {
next += this . _input . substr ( 0 , 20 - next . length ) ;
}
return ( next . substr ( 0 , 20 ) + ( next . length > 20 ? '...' : '' ) ) . replace ( /\n/g , "" ) ;
} ,
// displays the character position where the lexing error occurred, i.e. for error messages
showPosition : function ( ) {
var pre = this . pastInput ( ) ;
var c = new Array ( pre . length + 1 ) . join ( "-" ) ;
return pre + this . upcomingInput ( ) + "\n" + c + "^" ;
} ,
// test the lexed token: return FALSE when not a match, otherwise return token
test _match : function ( match , indexed _rule ) {
var token ,
lines ,
backup ;
if ( this . options . backtrack _lexer ) {
// save context
backup = {
yylineno : this . yylineno ,
yylloc : {
first _line : this . yylloc . first _line ,
last _line : this . last _line ,
first _column : this . yylloc . first _column ,
last _column : this . yylloc . last _column
} ,
yytext : this . yytext ,
match : this . match ,
matches : this . matches ,
matched : this . matched ,
yyleng : this . yyleng ,
offset : this . offset ,
_more : this . _more ,
_input : this . _input ,
yy : this . yy ,
conditionStack : this . conditionStack . slice ( 0 ) ,
done : this . done
} ;
if ( this . options . ranges ) {
backup . yylloc . range = this . yylloc . range . slice ( 0 ) ;
}
}
lines = match [ 0 ] . match ( /(?:\r\n?|\n).*/g ) ;
if ( lines ) {
this . yylineno += lines . length ;
}
this . yylloc = {
first _line : this . yylloc . last _line ,
last _line : this . yylineno + 1 ,
first _column : this . yylloc . last _column ,
last _column : lines ?
lines [ lines . length - 1 ] . length - lines [ lines . length - 1 ] . match ( /\r?\n?/ ) [ 0 ] . length : this . yylloc . last _column + match [ 0 ] . length
} ;
this . yytext += match [ 0 ] ;
this . match += match [ 0 ] ;
this . matches = match ;
this . yyleng = this . yytext . length ;
if ( this . options . ranges ) {
this . yylloc . range = [ this . offset , this . offset += this . yyleng ] ;
}
this . _more = false ;
this . _backtrack = false ;
this . _input = this . _input . slice ( match [ 0 ] . length ) ;
this . matched += match [ 0 ] ;
token = this . performAction . call ( this , this . yy , this , indexed _rule , this . conditionStack [ this . conditionStack . length - 1 ] ) ;
if ( this . done && this . _input ) {
this . done = false ;
}
if ( token ) {
return token ;
} else if ( this . _backtrack ) {
// recover context
for ( var k in backup ) {
this [ k ] = backup [ k ] ;
}
return false ; // rule action called reject() implying the next rule should be tested instead.
}
return false ;
} ,
// return next match in input
next : function ( ) {
if ( this . done ) {
return this . EOF ;
}
if ( ! this . _input ) {
this . done = true ;
}
var token ,
match ,
tempMatch ,
index ;
if ( ! this . _more ) {
this . yytext = '' ;
this . match = '' ;
}
var rules = this . _currentRules ( ) ;
for ( var i = 0 ; i < rules . length ; i ++ ) {
tempMatch = this . _input . match ( this . rules [ rules [ i ] ] ) ;
if ( tempMatch && ( ! match || tempMatch [ 0 ] . length > match [ 0 ] . length ) ) {
match = tempMatch ;
index = i ;
if ( this . options . backtrack _lexer ) {
token = this . test _match ( tempMatch , rules [ i ] ) ;
if ( token !== false ) {
return token ;
} else if ( this . _backtrack ) {
match = false ;
continue ; // rule action called reject() implying a rule MISmatch.
} else {
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
return false ;
}
} else if ( ! this . options . flex ) {
break ;
}
}
}
if ( match ) {
token = this . test _match ( match , rules [ index ] ) ;
if ( token !== false ) {
return token ;
}
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
return false ;
}
if ( this . _input === "" ) {
return this . EOF ;
} else {
return this . parseError ( 'Lexical error on line ' + ( this . yylineno + 1 ) + '. Unrecognized text.\n' + this . showPosition ( ) , {
text : "" ,
token : null ,
line : this . yylineno
} ) ;
}
} ,
2017-06-19 13:47:55 +00:00
// return next match that has a token
lex : function lex ( ) {
var r = this . next ( ) ;
if ( r ) {
return r ;
} else {
return this . lex ( ) ;
}
} ,
2017-06-19 00:17:56 +00:00
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
begin : function begin ( condition ) {
this . conditionStack . push ( condition ) ;
} ,
// pop the previously active lexer condition state off the condition stack
popState : function popState ( ) {
var n = this . conditionStack . length - 1 ;
if ( n > 0 ) {
return this . conditionStack . pop ( ) ;
} else {
return this . conditionStack [ 0 ] ;
}
} ,
// produce the lexer rule set which is active for the currently active lexer condition state
_currentRules : function _currentRules ( ) {
if ( this . conditionStack . length && this . conditionStack [ this . conditionStack . length - 1 ] ) {
return this . conditions [ this . conditionStack [ this . conditionStack . length - 1 ] ] . rules ;
} else {
return this . conditions [ "INITIAL" ] . rules ;
}
} ,
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
topState : function topState ( n ) {
n = this . conditionStack . length - 1 - Math . abs ( n || 0 ) ;
if ( n >= 0 ) {
return this . conditionStack [ n ] ;
} else {
return "INITIAL" ;
}
} ,
// alias for begin(condition)
pushState : function pushState ( condition ) {
this . begin ( condition ) ;
} ,
// return the number of states currently on the stack
stateStackSize : function stateStackSize ( ) {
return this . conditionStack . length ;
} ,
options : {
2017-06-19 13:47:55 +00:00
"moduleName" : "temp"
2017-06-19 00:17:56 +00:00
} ,
performAction : function anonymous ( yy , yy _ , $avoiding _name _collisions , YY _START ) {
function ERR ( yy , err ) {
2017-06-19 15:31:46 +00:00
console . log ( "hmmlib error: L%d: %s\n" , yy . line , err ) ;
throw {
message : err ,
line : yy . line
} ;
2017-06-19 00:17:56 +00:00
}
function CHECKESCAPE ( yy , str ) {
2017-06-19 15:31:46 +00:00
if ( "[]:@~\\\"" . indexOf ( str ) == - 1 ) {
2017-06-19 00:17:56 +00:00
ERR ( yy , "hmmlib: Unknown backslash escape code: %s" , str ) ;
}
}
function UNQUOTE ( yy , str ) {
var i = 0 ;
var j = 0 ;
while ( ( j = str . indexOf ( '\\' , i ) ) != - 1 ) {
CHECKESCAPE ( yy , str . charAt ( j ) ) ;
str = str . slice ( i , j ) + str . slice ( j + 1 ) ;
i = j + 1 ;
}
return str ;
}
function M _ ( yy , str , s ) {
yy . an . markers . push ( {
type : str
} ) ;
yy . mnext = s ;
}
function M _ADD ( yy , t , n ) {
yy . an . markers [ yy . an . markers . length - 1 ] . marker = t . substr ( 0 , n ) ;
2017-06-19 13:47:55 +00:00
yy . an . markers [ yy . an . markers . length - 1 ] . offset = yy . an . text . length ;
if ( yy . mnext === "TEXT" ) {
yy . an . text += t . substr ( 0 , n ) ;
}
2017-06-19 00:17:56 +00:00
}
function MX _ADD ( yy , c ) {
2017-06-19 13:47:55 +00:00
var m = yy . an . markers [ yy . an . markers . length - 1 ] ;
if ( m . parameter ) {
m . parameter += c ;
} else {
m . parameter = c ;
}
2017-06-19 00:17:56 +00:00
yy . an . text += c ;
}
function NEWANNO ( yy ) {
if ( ! yy . first ) yy . annos . push ( yy . an ) ;
yy . an = {
line : yy . line ,
text : "" ,
references : [ ] ,
markers : [ ] ,
} ;
yy . an . line = yy . line ;
yy . first = false ;
}
var YYSTATE = YY _START ;
switch ( $avoiding _name _collisions ) {
case 0 :
ERR ( yy , "Unexpected EOF, video close tag not found." ) ;
break ;
case 1 :
yy . line ++ ;
break ;
case 2 :
yy _ . begin ( "VIDEO" ) ;
break ;
case 3 :
ERR ( yy , "Missing video tag." ) ;
break ;
case 4 :
break ;
case 5 :
yy . attr = "member" ;
yy _ . begin ( "V_ATTR" ) ;
break ;
case 6 :
2017-06-19 17:23:17 +00:00
yy . attr = "stream_platform" ;
2017-06-19 00:17:56 +00:00
yy _ . begin ( "V_ATTR" ) ;
break ;
case 7 :
2017-06-19 17:23:17 +00:00
yy . attr = "stream_username" ;
2017-06-19 00:17:56 +00:00
yy _ . begin ( "V_ATTR" ) ;
break ;
case 8 :
2017-06-19 17:23:17 +00:00
yy . attr = "project" ;
2017-06-19 00:17:56 +00:00
yy _ . begin ( "V_ATTR" ) ;
break ;
case 9 :
2017-06-19 17:23:17 +00:00
yy . attr = "title" ;
2017-06-19 00:17:56 +00:00
yy _ . begin ( "V_ATTR" ) ;
break ;
case 10 :
2017-06-19 17:23:17 +00:00
yy . attr = "vod_platform" ;
2017-06-19 00:17:56 +00:00
yy _ . begin ( "V_ATTR" ) ;
break ;
case 11 :
2017-06-19 17:23:17 +00:00
yy . attr = "id" ;
2017-06-19 00:17:56 +00:00
yy _ . begin ( "V_ATTR" ) ;
break ;
case 12 :
2017-06-20 20:15:26 +00:00
yy . attr = "co_hosts"
yy _ . begin ( "V2_ATTR" ) ;
2017-06-19 00:17:56 +00:00
break ;
case 13 :
2017-06-20 20:15:26 +00:00
yy . attr = "guests"
yy _ . begin ( "V2_ATTR" ) ;
2017-06-19 00:17:56 +00:00
break ;
case 14 :
2017-06-20 20:15:26 +00:00
yy . attr = "annotators" ;
yy _ . begin ( "V2_ATTR" ) ;
2017-06-19 00:17:56 +00:00
break ;
case 15 :
2017-06-19 17:23:17 +00:00
yy _ . begin ( "ANNOTATION" ) ;
break ;
case 16 :
ERR ( yy , "Invalid char '" + yy _ . yytext + "' in video tag." ) ;
break ;
case 17 :
yy _ . begin ( "VIDEO" ) ;
break ;
case 18 :
2017-06-19 00:17:56 +00:00
yy . meta [ yy . attr ] = yy _ . yytext ;
yy _ . begin ( "VIDEO" ) ;
break ;
2017-06-19 17:23:17 +00:00
case 19 :
2017-06-19 00:17:56 +00:00
yy . meta [ yy . attr ] = UNQUOTE ( yy , yy _ . yytext . substr ( 1 , yy _ . yyleng - 2 ) ) ;
yy _ . begin ( "VIDEO" ) ;
break ;
2017-06-19 17:23:17 +00:00
case 20 :
2017-06-19 00:17:56 +00:00
yy _ . less ( 0 ) ;
yy _ . begin ( "VIDEO" ) ;
break ;
2017-06-19 17:23:17 +00:00
case 21 :
2017-06-20 20:15:26 +00:00
yy _ . begin ( "VIDEO" ) ;
break ;
case 22 :
yy . meta [ yy . attr ] . push ( yy _ . yytext ) ;
yy _ . begin ( "VIDEO" ) ;
break ;
case 23 :
yy . meta [ yy . attr ] . push ( UNQUOTE ( yy , yy _ . yytext . substr ( 1 , yy _ . yyleng - 2 ) ) ) ;
yy _ . begin ( "VIDEO" ) ;
break ;
case 24 :
yy _ . less ( 0 ) ;
yy _ . begin ( "VIDEO" ) ;
break ;
case 25 :
2017-06-19 15:31:46 +00:00
NEWANNO ( yy ) ;
return 1 ;
break ;
2017-06-20 20:15:26 +00:00
case 26 :
2017-06-19 00:17:56 +00:00
NEWANNO ( yy ) ;
yy . an . time = yy _ . yytext . substr ( 1 , yy _ . yyleng - 4 ) ;
yy _ . begin ( "AUTHOR" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 27 :
2017-06-19 00:17:56 +00:00
NEWANNO ( yy ) ;
yy . an . time = yy _ . yytext . substr ( 1 , yy _ . yyleng - 2 ) ;
yy _ . begin ( "TEXT_START" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 28 :
2017-06-19 15:31:46 +00:00
ERR ( yy , "Timecode '" + yy _ . yytext + "' out of range." ) ;
2017-06-19 00:17:56 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 29 :
2017-06-19 00:17:56 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 30 :
2017-06-19 15:31:46 +00:00
ERR ( yy , "Cannot parse annotation. Expected timecode." ) ;
break ;
2017-06-20 20:15:26 +00:00
case 31 :
2017-06-19 00:17:56 +00:00
M _ ( yy , "CATEGORY" , "TEXT" ) ;
yy _ . begin ( "MARKER" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 32 :
2017-06-19 00:17:56 +00:00
M _ ( yy , "MEMBER" , "TEXT" ) ;
yy _ . begin ( "MARKER" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 33 :
2017-06-19 00:17:56 +00:00
M _ ( yy , "PROJECT" , "TEXT" ) ;
yy _ . begin ( "MARKER" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 34 :
2017-06-19 00:17:56 +00:00
yy _ . less ( 0 ) ;
yy _ . begin ( "TEXT" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 35 :
2017-06-19 00:17:56 +00:00
ERR ( yy , "Unknown character '" + yy _ . yytext + "' after timecode." ) ;
break ;
2017-06-20 20:15:26 +00:00
case 36 :
2017-06-19 00:17:56 +00:00
yy . an . text += yy _ . yytext ;
break ;
2017-06-20 20:15:26 +00:00
case 37 :
2017-06-19 00:17:56 +00:00
CHECKESCAPE ( yy , yy _ . yytext . charAt ( 1 ) ) ;
yy . an . text += yy _ . yytext . substr ( 1 , yy _ . yyleng - 1 ) ;
break ;
2017-06-20 20:15:26 +00:00
case 38 :
2017-06-19 00:17:56 +00:00
yy . an . text += ' ' ;
M _ ( yy , "CATEGORY" , "TEXT" ) ;
yy _ . begin ( "MARKER" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 39 :
2017-06-19 00:17:56 +00:00
yy . an . text += ' ' ;
M _ ( yy , "MEMBER" , "TEXT" ) ;
yy _ . begin ( "MARKER" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 40 :
2017-06-19 00:17:56 +00:00
yy . an . text += ' ' ;
M _ ( yy , "PROJECT" , "TEXT" ) ;
yy _ . begin ( "MARKER" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 41 :
2017-06-19 00:17:56 +00:00
M _ ( yy , "CATEGORY" , "MARKER_XTRA" ) ;
yy _ . begin ( "MARKER" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 42 :
2017-06-19 00:17:56 +00:00
M _ ( yy , "MEMBER" , "MARKER_XTRA" ) ;
yy _ . begin ( "MARKER" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 43 :
2017-06-19 00:17:56 +00:00
M _ ( yy , "PROJECT" , "MARKER_XTRA" ) ;
yy _ . begin ( "MARKER" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 44 :
2017-06-19 00:17:56 +00:00
yy _ . begin ( "AFTERTEXT" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 45 :
2017-06-19 00:17:56 +00:00
yy . ref . offset = yy . an . text . length ;
yy _ . begin ( "REF" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 46 :
2017-06-19 00:17:56 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 47 :
2017-06-19 15:31:46 +00:00
yy . an . text += ' ' ;
2017-06-19 00:17:56 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 48 :
2017-06-19 15:31:46 +00:00
yy . an . text += yy _ . yytext ;
break ;
2017-06-20 20:15:26 +00:00
case 49 :
2017-06-19 00:17:56 +00:00
M _ADD ( yy , yy _ . yytext ) ;
yy _ . begin ( yy . mnext ) ;
break ;
2017-06-20 20:15:26 +00:00
case 50 :
2017-06-19 00:17:56 +00:00
M _ADD ( yy , yy _ . yytext . substr ( 1 , yy _ . yyleng - 2 ) ) ;
yy _ . begin ( yy . mnext ) ;
break ;
2017-06-20 20:15:26 +00:00
case 51 :
2017-06-19 00:17:56 +00:00
ERR ( yy , "Cannot parse Marker. Expected quoted or alphanumeric attribute." ) ;
break ;
2017-06-20 20:15:26 +00:00
case 52 :
2017-06-19 00:17:56 +00:00
MX _ADD ( yy , ']' ) ;
break ;
2017-06-20 20:15:26 +00:00
case 53 :
2017-06-19 17:23:17 +00:00
MX _ADD ( yy , '#' ) ;
break ;
2017-06-20 20:15:26 +00:00
case 54 :
2017-06-19 00:17:56 +00:00
yy _ . begin ( "TEXT" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 55 :
2017-06-19 00:17:56 +00:00
if ( yy . an . markers [ yy . an . markers . length - 1 ] . parameter ) {
MX _ADD ( yy , ' ' ) ;
}
break ;
2017-06-20 20:15:26 +00:00
case 56 :
2017-06-19 17:23:17 +00:00
var m = yy . an . markers [ yy . an . markers . length - 1 ] ;
if ( m . type == "PROJECT" ) {
m . episode = yy _ . yytext . substr ( 2 ) ;
} else {
MX _ADD ( yy _ . yytext . substr ( 1 ) ) ;
}
break ;
2017-06-20 20:15:26 +00:00
case 57 :
2017-06-19 15:31:46 +00:00
MX _ADD ( yy , yy _ . yytext ) ;
2017-06-19 00:17:56 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 58 :
2017-06-19 15:31:46 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 59 :
2017-06-19 00:17:56 +00:00
yy . attr = "site" ;
yy _ . begin ( "R_ATTR" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 60 :
2017-06-19 00:17:56 +00:00
yy . attr = "page" ;
yy _ . begin ( "R_ATTR" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 61 :
2017-06-19 00:17:56 +00:00
yy . attr = "url" ;
yy _ . begin ( "R_ATTR" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 62 :
2017-06-19 00:17:56 +00:00
yy . attr = "title" ;
yy _ . begin ( "R_ATTR" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 63 :
2017-06-19 00:17:56 +00:00
yy . attr = "article" ;
yy _ . begin ( "R_ATTR" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 64 :
2017-06-19 00:17:56 +00:00
yy . attr = "author" ;
yy _ . begin ( "R_ATTR" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 65 :
2017-06-19 00:17:56 +00:00
yy . attr = "editor" ;
yy _ . begin ( "R_ATTR" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 66 :
2017-06-19 00:17:56 +00:00
yy . attr = "publisher" ;
yy _ . begin ( "R_ATTR" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 67 :
2017-06-19 00:17:56 +00:00
yy . attr = "isbn" ;
yy _ . begin ( "R_ATTR" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 68 :
2017-06-19 00:17:56 +00:00
yy . an . references . push ( yy . ref ) ;
yy . ref = { } ;
yy _ . begin ( "TEXT" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 69 :
2017-06-19 15:31:46 +00:00
ERR ( yy , "Unexpected item in ref: " + yy _ . yytext ) ;
2017-06-19 00:17:56 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 70 :
2017-06-19 15:31:46 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 71 :
2017-06-19 00:17:56 +00:00
yy . ref [ yy . attr ] = yy _ . yytext ;
yy _ . begin ( "REF" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 72 :
2017-06-19 00:17:56 +00:00
yy . ref [ yy . attr ] = UNQUOTE ( yy , yy _ . yytext . substr ( 1 , yy _ . yyleng - 2 ) ) ;
yy _ . begin ( "REF" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 73 :
2017-06-19 00:17:56 +00:00
NEWANNO ( yy ) ;
return 1 ;
break ;
2017-06-20 20:15:26 +00:00
case 74 :
2017-06-19 00:17:56 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 75 :
2017-06-19 15:31:46 +00:00
yy _ . begin ( "QUOTES" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 76 :
2017-06-19 00:17:56 +00:00
yy _ . begin ( "CATEGORIES" ) ;
yy _ . less ( 1 ) ;
break ;
2017-06-20 20:15:26 +00:00
case 77 :
2017-06-19 00:17:56 +00:00
yy _ . begin ( "ANNOTATION" ) ;
yy _ . less ( 0 ) ;
break ;
2017-06-20 20:15:26 +00:00
case 78 :
2017-06-19 00:17:56 +00:00
ERR ( yy , "Unexpected thing after text node: " + yy _ . yytext ) ;
break ;
2017-06-20 20:15:26 +00:00
case 79 :
2017-06-19 15:31:46 +00:00
ERR ( yy , "Unexpected thing after text node: " + yy _ . yytext ) ;
2017-06-19 00:17:56 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 80 :
2017-06-19 15:31:46 +00:00
yy . an . author = yy _ . yytext . substr ( 0 , yy _ . yyleng - 1 ) ;
yy _ . begin ( "TEXT_START" ) ;
2017-06-19 00:17:56 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 81 :
2017-06-19 00:17:56 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 82 :
2017-06-19 15:31:46 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 83 :
2017-06-19 00:17:56 +00:00
yy . an . markers . push ( {
2017-06-19 13:47:55 +00:00
type : "CATEGORY" ,
2017-06-19 00:17:56 +00:00
marker : yy _ . yytext . substr ( 1 , yy _ . yyleng - 1 ) ,
offset : - 1
} ) ;
break ;
2017-06-20 20:15:26 +00:00
case 84 :
2017-06-19 00:17:56 +00:00
yy . an . markers . push ( {
2017-06-19 13:47:55 +00:00
type : "CATEGORY" ,
2017-06-19 00:17:56 +00:00
marker : UNQUOTE ( yy , yy _ . yytext . substr ( 2 , yy _ . yyleng - 3 ) ) ,
offset : - 1
} ) ;
break ;
2017-06-20 20:15:26 +00:00
case 85 :
2017-06-19 15:31:46 +00:00
yy _ . begin ( "QUOTES" ) ;
2017-06-19 00:17:56 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 86 :
2017-06-19 15:31:46 +00:00
yy _ . begin ( "ANNOTATION" ) ;
2017-06-19 00:17:56 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 87 :
2017-06-19 15:31:46 +00:00
ERR ( yy , "Unexpected character in category tag: " + yy _ . yytext ) ;
2017-06-19 00:17:56 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 88 :
2017-06-19 15:31:46 +00:00
break ;
2017-06-20 20:15:26 +00:00
case 89 :
yy . an . quote = {
author : "" ,
id : parseInt ( yy _ . yytext )
} ;
2017-06-19 00:17:56 +00:00
yy _ . begin ( "ANNOTATION" ) ;
break ;
2017-06-20 20:15:26 +00:00
case 90 :
2017-06-19 00:17:56 +00:00
yy . an . quote . author += yy _ . yytext ;
break ;
2017-06-20 20:15:26 +00:00
case 91 :
2017-06-19 00:17:56 +00:00
ERR ( yy , "Unexpected character in quotes tag: " + yy _ . yytext ) ;
break ;
}
} ,
2017-06-20 20:15:26 +00:00
rules : [ /^(?:$)/ , /^(?:\r\n|\n)/ , /^(?:(\[video\b))/ , /^(?:.)/ , /^(?:([\t \r]+))/ , /^(?:member([\t \r]*)=)/ , /^(?:stream_platform([\t \r]*)=)/ , /^(?:stream_username([\t \r]*)=)/ , /^(?:project([\t \r]*)=)/ , /^(?:title([\t \r]*)=)/ , /^(?:vod_platform([\t \r]*)=)/ , /^(?:id([\t \r]*)=)/ , /^(?:co-host([\t \r]*)=)/ , /^(?:guest([\t \r]*)=)/ , /^(?:annotator([\t \r]*)=)/ , /^(?:\])/ , /^(?:.)/ , /^(?:([\t \r]+))/ , /^(?:([^\" \]\t\r\n][^ \]\t\r\n]*))/ , /^(?:("([^\n\"\\]|\\.)*"))/ , /^(?:\])/ , /^(?:([\t \r]+))/ , /^(?:([^\" \]\t\r\n][^ \]\t\r\n]*))/ , /^(?:("([^\n\"\\]|\\.)*"))/ , /^(?:\])/ , /^(?:\[\/video\])/ , /^(?:(\[[0-9]{1,2}(:[0-5][0-9]){1,2}\])(\[)@)/ , /^(?:(\[[0-9]{1,2}(:[0-5][0-9]){1,2}\]))/ , /^(?:(\[[0-9]{1,2}(:[6-9][0-9]){1,2}\]))/ , /^(?:([\t \r]+))/ , /^(?:.)/ , /^(?:(\[):)/ , /^(?:(\[)@)/ , /^(?:(\[)~)/ , /^(?:(\[))/ , /^(?:.)/ , /^(?:([^\\\:\@\~\[\]\r\n\t ])+)/ , /^(?:\\.)/ , /^(?:[ \r\t]+:)/ , /^(?:[ \r\t]+@)/ , /^(?:[ \r\t]+~)/ , /^(?:(\[):)/ , /^(?:(\[)@)/ , /^(?:(\[)~)/ , /^(?:\])/ , /^(?:(\[)ref\b)/ , /^(?:(\[))/ , /^(?:([\t \r]+))/ , /^(?:.)/ , /^(?:([0-9a-zA-Z][0-9a-zA-Z_]*))/ , /^(?:("([^\n\"\\]|\\.)*"))/ , /^(?:.)/ , /^(?:\\)/ , /^(?:\\#)/ , /^(?:\])/ , /^(?:[ ])/ , /^(?:[ ]#[0-9]+)/ , /^(?:.)/ , /^(?:([\t \r]+))/ , /^(?:site([\t \r]*)=)/ , /^(?:page([\t \r]*)=)/ , /^(?:url([\t \r]*)=)/ , /^(?:title([\t \r]*)=)/ , /^(?:article([\t \r]*)=)/ , /^(?:author([\t \r]*)=)/ , /^(?:editor([\t \r]*)=)/ , /^(?:publisher([\t \r]*)=)/ , /^(?:isbn([\t \r]*)=)/ , /^(?:\])/ , /^(?:.)/ , /^(?:([\t \r]+))/ , /^(?:([^\" \]\t\r\n][^ \]\t\r\n]*))/ , /^(?:("([^\n\"\\]|\\.)*"))/ , /^(?:\[\/video\])/ , /^(?:([\t \r]+))/ , /^(?:(\[)quote\b)/ , /^(?:(\[):)/ , /^(?:(\[)[0-9])/ , /^(?:..)/ , /^(?:.)/ , /^(?:[^\]\n]+\])/ , /^(?:([\t \r]+))/ , /^(?:([\t \r]+))/ , /^(?::([^\" \]\t\r\n][^ \]\t\r\n]*))/ , /^(?::("([^\n\"\\]|\\.)*"))/ , /^(?:\](\[))/ , /^(?:\])/ , /^(?:.)/ , /^(?:([\t \r]+))/ , /^(?:[0-9]+([\t \r]*)\])/ , /^(?:([0-9a-zA-Z][0-9a-zA-Z_]*))/ , /^(?:.)/ ] ,
2017-06-19 00:17:56 +00:00
conditions : {
"QUOTES" : {
2017-06-20 20:15:26 +00:00
"rules" : [ 0 , 1 , 88 , 89 , 90 , 91 ] ,
2017-06-19 00:17:56 +00:00
"inclusive" : true
} ,
"CATEGORIES" : {
2017-06-20 20:15:26 +00:00
"rules" : [ 0 , 1 , 82 , 83 , 84 , 85 , 86 , 87 ] ,
2017-06-19 00:17:56 +00:00
"inclusive" : true
} ,
"AUTHOR" : {
2017-06-20 20:15:26 +00:00
"rules" : [ 0 , 1 , 80 , 81 ] ,
2017-06-19 00:17:56 +00:00
"inclusive" : true
} ,
"AFTERTEXT" : {
2017-06-20 20:15:26 +00:00
"rules" : [ 0 , 1 , 73 , 74 , 75 , 76 , 77 , 78 , 79 ] ,
2017-06-19 00:17:56 +00:00
"inclusive" : true
} ,
"R_ATTR" : {
2017-06-20 20:15:26 +00:00
"rules" : [ 0 , 1 , 70 , 71 , 72 ] ,
2017-06-19 00:17:56 +00:00
"inclusive" : true
} ,
"REF" : {
2017-06-20 20:15:26 +00:00
"rules" : [ 0 , 1 , 58 , 59 , 60 , 61 , 62 , 63 , 64 , 65 , 66 , 67 , 68 , 69 ] ,
2017-06-19 00:17:56 +00:00
"inclusive" : true
} ,
"MARKER_XTRA" : {
2017-06-20 20:15:26 +00:00
"rules" : [ 0 , 1 , 52 , 53 , 54 , 55 , 56 , 57 ] ,
2017-06-19 00:17:56 +00:00
"inclusive" : true
} ,
"MARKER" : {
2017-06-20 20:15:26 +00:00
"rules" : [ 0 , 1 , 49 , 50 , 51 ] ,
2017-06-19 00:17:56 +00:00
"inclusive" : true
} ,
"TEXT" : {
2017-06-20 20:15:26 +00:00
"rules" : [ 0 , 1 , 36 , 37 , 38 , 39 , 40 , 41 , 42 , 43 , 44 , 45 , 46 , 47 , 48 ] ,
2017-06-19 00:17:56 +00:00
"inclusive" : true
} ,
"TEXT_START" : {
2017-06-20 20:15:26 +00:00
"rules" : [ 0 , 1 , 31 , 32 , 33 , 34 , 35 ] ,
2017-06-19 00:17:56 +00:00
"inclusive" : true
} ,
"ANNOTATION" : {
2017-06-20 20:15:26 +00:00
"rules" : [ 0 , 1 , 25 , 26 , 27 , 28 , 29 , 30 ] ,
"inclusive" : true
} ,
"V2_ATTR" : {
"rules" : [ 0 , 1 , 21 , 22 , 23 , 24 ] ,
2017-06-19 00:17:56 +00:00
"inclusive" : true
} ,
"V_ATTR" : {
2017-06-19 17:23:17 +00:00
"rules" : [ 0 , 1 , 17 , 18 , 19 , 20 ] ,
2017-06-19 00:17:56 +00:00
"inclusive" : true
} ,
"VIDEO" : {
2017-06-19 17:23:17 +00:00
"rules" : [ 0 , 1 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ] ,
2017-06-19 00:17:56 +00:00
"inclusive" : true
} ,
"INITIAL" : {
"rules" : [ 0 , 1 , 2 , 3 ] ,
"inclusive" : true
}
}
2017-06-19 13:47:55 +00:00
}