'docrule ::= "@-moz-document" S+ url-list "{" S* ruleset* "}"
url-list ::= url-item ( "," S* url-item )*
url-item ::= ( "url(" | "url-prefix(" | "domain(" ) URL ")" |
"regexp(" string ")" S*'

def _parse_moz_document(self):

    while True:
        res = self._parse_moz_document_item()
        if (not res):
            break
        tok = self._tokenizer.get_next_token()
        if (not self._classifier.is_operator(tok)):
            self._add_result("expecting    ','    or    '{'", tok)
            self._tokenizer.put_back(tok)
        elif (tok['text'] == '{'):
            self._tokenizer.put_back(tok)
            break
        elif (tok['text'] != ','):
            self._add_result("expecting    ','    or    '{'", tok)
            self._tokenizer.put_back(tok)
    self._parse_inner_rulesets()
