ShaderTools.Hlsl.Binding.Binder.BindForStatement C# (CSharp) Method

BindForStatement() private method

private BindForStatement ( ForStatementSyntax syntax, Symbol parent ) : BoundForStatement
syntax ForStatementSyntax
parent ShaderTools.Hlsl.Symbols.Symbol
return BoundForStatement
        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)));
        }