コード例 #1
0
 public void Visit(ForLoop ast)
 {
     Exec(ast);
 }
コード例 #2
0
        public void Visit(ForLoop ast)
        {
            ast.Setup.Visit(this);

            ast.Predicate.Visit(this);

            if (ResolvingTypes && ast.Predicate.AstSymbolType.ExpressionType != ExpressionTypes.Boolean)
            {
                throw new InvalidSyntax("For loop predicate has to evaluate to a boolean");
            }

            ast.Update.Visit(this);

            ast.Body.Visit(this);

            SetScope(ast);
        }
コード例 #3
0
        private void ForDo(ForLoop forLoop)
        {
            MemorySpaces.CreateScope();

            Exec(forLoop.Setup);

            while (GetValue(Exec(forLoop.Predicate)))
            {
                Exec(forLoop.Update);

                Exec(forLoop.Body);
            }

            MemorySpaces.PopScope();
        }
コード例 #4
0
        public void Visit(ForLoop ast)
        {
            PrintWrap("ForLoop", () =>
                {
                    PrintWrap("For", () => ast.Setup.Visit(this));
                    PrintWrap("Until", () => ast.Predicate.Visit(this));
                    PrintWrap("Modify", () => ast.Update.Visit(this));

                    ast.Body.Visit(this);
                });
        }