def parse_rule(self, rule, is_separator, parent, level, begin):
        regions = []
        if self.printer is not None and not is_separator:
            if "name" in rule:
                self.printer(level, "== Rule " + rule["name"] + " [" + str(begin) + "] ==")
            else:
                self.printer(level, "== Rule [" + str(begin) + "] ==")
        rule_output = {"successive_match": False, "match": False, "begin": begin, "new_begin": begin, "end": begin, "regions": []}
        if "name" in rule:
            if parent != "":
                parent += ">"
            parent += rule["name"]
        good = True
        if "exclude" in rule:
            exclude_output = self.parse_rule(rule["exclude"], is_separator, parent, level+1, begin)
            if exclude_output["successive_match"]:
                good = False
        if good:
            if "match" in rule:
                if rule["match"] in self.re_cache:
                    re_pattern = self.re_cache[rule["match"]]
                else:
                    re_pattern = re.compile(rule["match"])
                if not is_separator and "separator" in self.grammar and ("before_separator" not in rule or rule["before_separator"]):
                    if self.printer is not None and not is_separator:
                        self.printer(level, "> Separator Before: " + str(begin))
                    separator_output = self.parse_rule(self.grammar["separator"], True, parent, level+1, begin)
                    if separator_output["successive_match"]:
                        begin = separator_output["new_begin"]
                        regions += separator_output["regions"]
                        if self.printer is not None and not is_separator:
                            self.printer(level, "> Match before sep")
                if self.printer is not None and not is_separator:
                    self.printer(level, "> Matching at [" + str(begin) + "]: " + rule["match"])
                matches = re_pattern.search(self.data[begin:len(self.data)])
                if matches is not None and matches.start() == 0:
                    rule_output["successive_match"] = True
                    rule_output["match"] = True
                    rule_output["begin"] = begin
                    rule_output["end"] = begin+matches.end()
                    rule_output["new_begin"] = rule_output["end"]
                    begin = rule_output["end"]
                    if "name" in rule:
                        regions.append({"begin": rule_output["begin"], "end": rule_output["end"], "value": self.data[rule_output["begin"]:rule_output["end"]], "parent": parent, "name": rule["name"]})
                        if self.printer is not None and not is_separator:
                            self.printer(level, "> Adding " + str(rule_output["begin"]) + ":" + str(rule_output["end"]))
                    else:
                        if self.printer is not None and not is_separator:
                            self.printer(level, "> Skip: " + str(rule_output["end"]))
                if not is_separator and rule_output["successive_match"] and "separator" in self.grammar and ("after_separator" not in rule or rule["after_separator"]):
                    if self.printer is not None and not is_separator:
                        self.printer(level, "> Separator After: " + str(rule_output["end"]))
                    separator_output = self.parse_rule(self.grammar["separator"], True, parent, level+1, begin)
                    if separator_output["successive_match"]:
                        begin = separator_output["new_begin"]
                        regions += separator_output["regions"]
                        if self.printer is not None and not is_separator:
                            self.printer(level, "> Match after sep")
            elif "parse" in rule:
                parse_output = self.parse_rule_list(rule["parse"], is_separator, parent, level+1, begin)
                if parse_output["successive_match"]:
                    if rule in "name":
                        regions.append({"begin": parse_output["begin"], "end": parse_output["end"], "value": self.data[parse_output["begin"]:parse_output["end"]], "parent": parent, "name": rule["name"]})
                    if parse_output["match"]:
                        rule_output["match"] = parse_output["match"]
                    begin = parse_output["new_begin"]
                    rule_output["new_begin"] = parse_output["new_begin"]
                    rule_output["begin"] = parse_output["begin"]
                    rule_output["end"] = parse_output["end"]
                    rule_output["successive_match"] = parse_output["successive_match"]
                    regions += parse_output["regions"]
            elif "parse_any" in rule:
                parse_output = self.parse_rule_list_any(rule["parse_any"], is_separator, parent, level+1, begin)
                if parse_output["successive_match"]:
                    if "name" in rule:
                        regions.append({"begin": parse_output["begin"], "end": parse_output["end"], "value": self.data[parse_output["begin"]:parse_output["end"]], "parent": parent, "name": rule["name"]})
                    if parse_output["match"]:
                        rule_output["match"] = parse_output["match"]
                    begin = parse_output["new_begin"]
                    rule_output["new_begin"] = parse_output["new_begin"]
                    rule_output["begin"] = parse_output["begin"]
                    rule_output["end"] = parse_output["end"]
                    rule_output["successive_match"] = parse_output["successive_match"]
                    regions += parse_output["regions"]
            elif "include" in rule:
                if "repository" in self.grammar and rule["include"] in self.grammar["repository"]:
                    if self.printer is not None and not is_separator:
                        self.printer(level, "> Include " + rule["include"])
                    parse_output = self.parse_rule(self.grammar["repository"][rule["include"]], is_separator, parent, level+1, begin)
                    if parse_output["successive_match"]:
                        if "name" in rule:
                            regions.append({"begin": parse_output["begin"], "end": parse_output["end"], "value": self.data[parse_output["begin"]:parse_output["end"]], "parent": parent, "name": rule["name"]})
                        if parse_output["match"]:
                            rule_output["match"] = parse_output["match"]
                        begin = parse_output["new_begin"]
                        rule_output["new_begin"] = parse_output["new_begin"]
                        rule_output["begin"] = parse_output["begin"]
                        rule_output["end"] = parse_output["end"]
                        rule_output["successive_match"] = parse_output["successive_match"]
                        regions += parse_output["regions"]
                else:
                    rule_output["successive_match"] = False

            if "multiple" in rule and rule["multiple"] and rule_output["successive_match"]:
                if self.printer is not None and not is_separator:
                    self.printer(level, "Multiple: " + str(begin))
                parse_output = self.parse_rule(rule, is_separator, parent, level+1, begin)
                if parse_output["successive_match"]:
                    if "name" in rule:
                        regions.append({"begin": parse_output["begin"], "end": parse_output["end"], "value": self.data[parse_output["begin"]:parse_output["end"]], "parent": parent, "name": rule["name"]})
                    if parse_output["match"]:
                        rule_output["match"] = parse_output["match"]
                    begin = parse_output["new_begin"]
                    rule_output["end"] = parse_output["end"]
                    rule_output["new_begin"] = parse_output["new_begin"]
                    regions += parse_output["regions"]

        if rule_output["successive_match"]:
            if "name" in rule:
                if self.printer is not None and not is_separator:
                    self.printer(level, "> Matched")
        elif ("optional" in rule and rule["optional"]) or ("multiple" in rule and rule["multiple"]):
            rule_output["successive_match"] = True
            if self.printer is not None and not is_separator:
                self.printer(level, "> Optional")
        if "name" in rule:
            if self.printer is not None and not is_separator:
                self.printer(level, "== EndRule " + rule["name"] + " [" + str(begin) + "] ==")
        else:
            if self.printer is not None and not is_separator:
                self.printer(level, "== EndRule [" + str(begin) + "] ==")
        rule_output["regions"] = regions
        return rule_output

    # Find all (return all)
dataset/ETHPy150Open spywhere/Javatar/parser/GrammarParser.py/GrammarParser.parse_rule/swapped operands of `in`