Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

790 B
Raw Blame
grammar BBCode;

options { language=Dart; }

document
    : element* EOF
    ;

element
    : tag
    | plain
    | bgm
    | musume
    | sticker
    ;

tag
    : '[' tagName=STRING ('=' attr=STRING)? ']' content=element* '[/' STRING ']'
    ;

plain
    : (STRING | '=' | '/' | '[' | ']' | '(' | ')')+
    // workaround unless these will break tag reconginze
    | '[来自Bangumi for android]'
    | '[来自Bangumi for iOS]'
    ;

bgm
    : ('(bgm' | '(BGM') id=STRING ')'
    ;

musume
    : '(musume_' id=STRING ')'
    ;

sticker
    : '(=A=)'
    | '(=w=)'
    | '(-w=)'
    | '(S_S)'
    | '(=v=)'
    | '(@_@)'
    | '(=W=)'
    | '(TAT)'
    | '(T_T)'
    | '(=\'=)'
    | '(=3=)'
    | '(= =\')'
    | '(=///=)'
    | '(=.,=)'
    | '(:P)'
    | '(LOL)';

STRING : ~[=[\]()]+;