@@ -0,0 +1,951 @@
+package wyautl.util;%0A%0Aimport wyautl.rw.RewriteState;%0Aimport wyautl.rw.RewriteStep;%0Aimport wyautl.rw.Rewriter;%0A%0Apublic class ThrottledRewriter implements Rewriter %7B%0A%09private final Rewriter rewriter;%0A%09%0A%09private final int maxSteps;%0A%09%0A%09public ThrottledRewriter(Rewriter rewriter, int maxSteps) %7B%0A%09%09this.rewriter = rewriter;%0A%09%09this.maxSteps = maxSteps;%0A%09%7D%0A%0A%09@Override%0A%09public RewriteState state() %7B%0A%09%09return rewriter.state();%0A%09%7D%0A%0A%09@Override%0A%09public void reset(RewriteState state) %7B%0A%09%09rewriter.reset(state);%0A%09%7D%0A%0A%09@Override%0A%09public RewriteStep apply(int choice) %7B%0A%09%09return rewriter.apply(choice);%0A%09%7D%0A%0A%09@Override%0A%09public RewriteStep apply() %7B%0A%09%09int r;%0A%09%09RewriteState state = rewriter.state();%0A%09%09int count = 0;%0A%09%09while (count %3C maxSteps && (r = AbstractRewriter.selectFirstUnvisited(state)) != -1) %7B%0A%09%09%09RewriteStep step = apply(r);%0A%09%09%09state = step.after();%0A%09%09%09count = count + 1;%0A%09%09%7D %0A%09%09// This doesn't make sense%0A%09%09return new RewriteStep(state,0,state);%09%0A%09%7D%0A%7D%0A

Add throttled rewriter