1 package org.jruby.ast.visitor.rewriter;2 3 import org.jruby.ast.visitor.rewriter.utils.DRegxReWriteVisitor;4 import org.jruby.ast.visitor.rewriter.utils.HereDocReWriteVisitor;5 import org.jruby.ast.visitor.rewriter.utils.IgnoreCommentsReWriteVisitor;6 import org.jruby.ast.visitor.rewriter.utils.MultipleAssignmentReWriteVisitor;7 import org.jruby.ast.visitor.rewriter.utils.ReWriterContext;8 import org.jruby.ast.visitor.rewriter.utils.ShortIfNodeReWriteVisitor;9 10 public class ReWriterFactory {11 12 private ReWriterContext config;13 14 public ReWriterFactory(ReWriterContext config) {15 this.config = config;16 }17 18 public ReWriteVisitor createShortIfNodeReWriteVisitor() {19 return new ShortIfNodeReWriteVisitor(config);20 }21 22 public ReWriteVisitor createMultipleAssignmentReWriteVisitor() {23 return new MultipleAssignmentReWriteVisitor(config);24 }25 26 public ReWriteVisitor createDRegxReWriteVisitor() {27 return new DRegxReWriteVisitor(config);28 }29 30 public ReWriteVisitor createHereDocReWriteVisitor() {31 return new HereDocReWriteVisitor(config);32 }33 34 public ReWriteVisitor createIgnoreCommentsReWriteVisitor() {35 return new IgnoreCommentsReWriteVisitor(config);36 }37 38 public ReWriteVisitor createReWriteVisitor() {39 return new ReWriteVisitor(config);40 }41 }42