require 'util/visitor' # Sequentially apply visitors class SequenceVisitor include Visitor def initialize(*visitors) @visitors = visitors end def visit(obj) @visitors.each {|v| obj.accept_visitor(v)} end end