code: private void visit(Rule rule, Visitor<Rule> visitor)
     {
        visitor.visit(rule);
  
        if (rule instanceof CompositeRule) {
           if (((CompositeRule) rule).getRules() != null)
           {
              for (Rule child : ((CompositeRule) rule).getRules()) {
                 visit(child, visitor);
              }
           }
        }
     }
docs: Method to call the {@link Visitor} for the supplied {@link Rule} and recursively calls itself, if the {@link Rule}
  is a {@link CompositeRule}.