def parse_rule(self, rule):
offset, prefix = <NUM_LIT:0>, '<STR_LIT>'<EOL>for match in self.rule_syntax.finditer(rule):<EOL><INDENT>prefix += rule[offset:match.start()]<EOL>g = match.groups()<EOL>if len(g[<NUM_LIT:0>])%<NUM_LIT:2>: <EOL><INDENT>prefix += match.group(<NUM_LIT:0>)[len(g[<NUM_LIT:0>]):]<EOL>offset = match.end()<EOL>continue<EOL><DEDENT>if prefix: yield prefix, None, None<EOL>name, filtr, conf = g[<NUM_LIT:1>:<NUM_LIT:4>] if not g[<NUM_LIT:2>] is None else g[<NUM_LIT:4>:<NUM_LIT:7>]<EOL>if not filtr: filtr = self.default_filter<EOL>yield name, filtr, conf or None<EOL>offset, prefix = match.end(), '<STR_LIT>'<EOL><DEDENT>if offset <= len(rule) or prefix:<EOL><INDENT>yield prefix+rule[offset:], None, None<EOL><DEDENT>
Parses a rule into a (name, filter, conf) token stream. If mode is
            None, name contains a static rule part.