Esempio n. 1
0
 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");
 }
Esempio n. 2
0
 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");
 }
Esempio n. 3
0
        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);
              });
              }
        }
Esempio n. 4
0
        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);
                });
            }
        }
Esempio n. 5
0
 public For For(ActionOnIntVar initialize, IntExprToBoolExpr condition, ActionOnIntVar increment)
 {
     return new For(initialize, condition, increment);
 }
Esempio n. 6
0
 public For For(ActionOnIntVar initialize, IntExprToBoolExpr condition, ActionOnIntVar increment)
 {
     return(new For(initialize, condition, increment));
 }