public For(ActionOnIntVar initialize, IntExprToBoolExpr condition, ActionOnIntVar increment) { this.initialize=initialize; this.condition=condition; this.increment=increment; this.cookie=FuncBuilder.Instance.StartInflightUtterance("For requires a Do"); }
public For(ActionOnIntVar initialize, IntExprToBoolExpr condition, ActionOnIntVar increment) { this.initialize = initialize; this.condition = condition; this.increment = increment; this.cookie = FuncBuilder.Instance.StartInflightUtterance("For requires a Do"); }
public void Do(ActionOnIntVar body) { var f=FuncBuilder.Instance; f.FinishInflightUtterance(cookie); using(f.OpenScope("for")) { var loopIndex=f.Declare.Int("loopIndex"); initialize(loopIndex); f.While(condition(loopIndex)) .Do(() => { body(loopIndex); increment(loopIndex); }); } }
public void Do(ActionOnIntVar body) { var f = FuncBuilder.Instance; f.FinishInflightUtterance(cookie); using (f.OpenScope("for")) { var loopIndex = f.Declare.Int("loopIndex"); initialize(loopIndex); f.While(condition(loopIndex)) .Do(() => { body(loopIndex); increment(loopIndex); }); } }
public For For(ActionOnIntVar initialize, IntExprToBoolExpr condition, ActionOnIntVar increment) { return new For(initialize, condition, increment); }
public For For(ActionOnIntVar initialize, IntExprToBoolExpr condition, ActionOnIntVar increment) { return(new For(initialize, condition, increment)); }