def _parse_tagfile(self):
rules = None<EOL>tag = None<EOL>for line in self.original:<EOL><INDENT>match = self.TAG_DECL_LINE.match(line)<EOL>if match:<EOL><INDENT>if tag and rules:<EOL><INDENT>yield tag, rules<EOL><DEDENT>rules = []<EOL>tag = match.group(<NUM_LIT:1>)<EOL>continue<EOL><DEDENT>match = self.TAG_RULE_LINE.match(line)<EOL>if match:<EOL><INDENT>source = match.group(<NUM_LIT:1>)<EOL>rules.append(self._parse_query(source))<EOL><DEDENT><DEDENT>
Parse the tagfile and yield tuples of tag_name, list of rule ASTs.