def validate_rule(self, rule):
        if "exclude" in rule:
            self.validate_rule(rule["exclude"])
        if "parse" in rule:
            self.validate_rule_list(rule["parse"])
        if "parse_any" in rule:
            self.validate_rule_list(rule["parse_any"])
        if "include" in rule:
            if not self.contain_rule(rule["include"]) and rule["include"] not in self.unexists_rules:
                self.unexists_rules.append(rule["include"])
            else:
                if rule["include"] in self.unused_rules:
                    while rule["include"] in self.unused_rules:
                        self.unused_rules.remove(rule["include"])
                    self.validate_rule(self.grammar["repository"][rule["include"]])
dataset/ETHPy150Open spywhere/Javatar/parser/GrammarParser.py/GrammarParser.validate_rule/original