コード例 #1
0
        public static Expression AnalyzeLoopExpr(SymplLoopExpr expr,
                                                 AnalysisScope scope)
        {
            var loopscope = new AnalysisScope(scope, "loop ");

            loopscope.IsLoop    = true; // needed for break and continue
            loopscope.LoopBreak = Expression.Label(typeof(object), "loop break");
            int len  = expr.Body.Length;
            var body = new Expression[len];

            for (int i = 0; i < len; i++)
            {
                body[i] = AnalyzeExpr(expr.Body[i], loopscope);
            }
            return(Expression.Loop(Expression.Block(typeof(object), body),
                                   loopscope.LoopBreak));
        }
コード例 #2
0
ファイル: ETGen.cs プロジェクト: rudimk/dlr-dotnet
 public static Expression AnalyzeLoopExpr (SymplLoopExpr expr,
                                           AnalysisScope scope) {
     var loopscope = new AnalysisScope(scope, "loop ");
     loopscope.IsLoop = true; // needed for break and continue
     loopscope.LoopBreak = Expression.Label(typeof(object), "loop break");
     int len = expr.Body.Length;
     var body = new Expression[len];
     for (int i = 0; i < len; i++) {
         body[i] = AnalyzeExpr(expr.Body[i], loopscope);
     }
     return Expression.Loop(Expression.Block(typeof(object), body), 
                            loopscope.LoopBreak);
 }