Пример #1
0
        public override void VisitForStatement(ForStatementSyntax node)
        {
            var binder = new ForLoopBinder(this.method, enclosing, node);

            AddToMap(node, binder);

            VisitPossibleEmbeddedStatement(node.Statement, binder);
        }
Пример #2
0
        public override void VisitForStatement(ForStatementSyntax node)
        {
            Debug.Assert((object)_method == _enclosing.ContainingMemberOrLambda);
            var binder = new ForLoopBinder(_enclosing, node);

            AddToMap(node, binder);

            VisitPossibleEmbeddedStatement(node.Statement, binder);
        }
Пример #3
0
        public override void VisitForStatement(ForStatementSyntax node)
        {
            Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda);
            Binder binder = new ForLoopBinder(_enclosing, node);

            AddToMap(node, binder);

            VariableDeclarationSyntax declaration = node.Declaration;

            if (declaration != null)
            {
                VisitRankSpecifiers(declaration.Type, binder);

                foreach (VariableDeclaratorSyntax variable in declaration.Variables)
                {
                    Visit(variable, binder);
                }
            }
            else
            {
                foreach (ExpressionSyntax initializer in node.Initializers)
                {
                    Visit(initializer, binder);
                }
            }

            ExpressionSyntax condition = node.Condition;

            if (condition != null)
            {
                binder = new ExpressionVariableBinder(condition, binder);
                AddToMap(condition, binder);
                Visit(condition, binder);
            }

            SeparatedSyntaxList <ExpressionSyntax> incrementors = node.Incrementors;

            if (incrementors.Count > 0)
            {
                var incrementorsBinder = new ExpressionListVariableBinder(incrementors, binder);
                AddToMap(incrementors.First(), incrementorsBinder);
                foreach (ExpressionSyntax incrementor in incrementors)
                {
                    Visit(incrementor, incrementorsBinder);
                }
            }

            VisitPossibleEmbeddedStatement(node.Statement, binder);
        }
Пример #4
0
        public override void VisitForStatement(ForStatementSyntax node)
        {
            Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda);
            var binder = new ForLoopBinder(_enclosing, node);

            AddToMap(node, binder);

            var declaration = node.Declaration;

            if (declaration != null)
            {
                foreach (var variable in declaration.Variables)
                {
                    if (variable.Initializer != null)
                    {
                        Visit(variable.Initializer.Value, binder);
                    }
                }
            }
            else
            {
                foreach (var initializer in node.Initializers)
                {
                    Visit(initializer, binder);
                }
            }

            if (node.Condition != null)
            {
                Visit(node.Condition, binder);
            }

            foreach (var incrementor in node.Incrementors)
            {
                Visit(incrementor, binder);
            }

            VisitPossibleEmbeddedStatement(node.Statement, binder);
        }
Пример #5
0
        public override void VisitForStatement(ForStatementSyntax node)
        {
            Debug.Assert((object)_method == _enclosing.ContainingMemberOrLambda);
            var binder = new ForLoopBinder(_enclosing, node);
            AddToMap(node, binder);

            VisitPossibleEmbeddedStatement(node.Statement, binder);
        }
Пример #6
0
        public override void VisitForStatement(ForStatementSyntax node)
        {
            Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda);
            Binder binder = new ForLoopBinder(_enclosing, node);
            AddToMap(node, binder);

            var declaration = node.Declaration;
            if (declaration != null)
            {
                foreach (var variable in declaration.Variables)
                {
                    Visit(variable, binder);
                }
            }
            else
            {
                foreach (var initializer in node.Initializers)
                {
                    Visit(initializer, binder);
                } 
            }

            ExpressionSyntax condition = node.Condition;
            if (condition != null)
            {
                binder = new ExpressionVariableBinder(condition, binder);
                AddToMap(condition, binder);
                Visit(condition, binder);
            }

            SeparatedSyntaxList<ExpressionSyntax> incrementors = node.Incrementors;
            if (incrementors.Count > 0)
            {
                var incrementorsBinder = new ExpressionListVariableBinder(incrementors, binder);
                AddToMap(incrementors.First(), incrementorsBinder);
                foreach (var incrementor in incrementors)
                {
                    Visit(incrementor, incrementorsBinder);
                }
            }

            VisitPossibleEmbeddedStatement(node.Statement, binder);
        }
Пример #7
0
        public override void VisitForStatement(ForStatementSyntax node)
        {
            Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda);
            var binder = new ForLoopBinder(_enclosing, node);
            AddToMap(node, binder);

            var declaration = node.Declaration;
            if (declaration != null)
            {
                foreach (var variable in declaration.Variables)
                {
                    if (variable.Initializer != null)
                    {
                        Visit(variable.Initializer.Value, binder);
                    }
                }
            }
            else
            {
                foreach (var initializer in node.Initializers)
                {
                    Visit(initializer, binder);
                } 
            }

            if (node.Condition != null)
            {
                Visit(node.Condition, binder);
            }

            foreach (var incrementor in node.Incrementors)
            {
                Visit(incrementor, binder);
            }

            VisitPossibleEmbeddedStatement(node.Statement, binder);
        }
Пример #8
0
        public override void VisitForStatement(ForStatementSyntax node)
        {
            var binder = new ForLoopBinder(this.method, enclosing, node);
            AddToMap(node, binder);

            VisitPossibleEmbeddedStatement(node.Statement, binder);
        }