Added a method to parse a rule