private BoundForStatement BindForStatement(ForStatementSyntax syntax, Symbol parent)
{
BindAttributes(syntax.Attributes);
var forStatementBinder = new Binder(_sharedBinderState, this);
// Note that we bind declarations in the current scope, not the for statement scope.
return new BoundForStatement(
syntax.Declaration != null ? Bind(syntax.Declaration, x => BindForStatementDeclaration(x, parent)) : null,
syntax.Initializer != null ? forStatementBinder.Bind(syntax.Initializer, forStatementBinder.BindExpression) : null,
forStatementBinder.Bind(syntax.Condition, forStatementBinder.BindExpression),
syntax.Incrementor != null ? forStatementBinder.Bind(syntax.Incrementor, forStatementBinder.BindExpression) : null,
forStatementBinder.Bind(syntax.Statement, x => forStatementBinder.BindStatement(x, parent)));
}