public override void Exit() { List <StatementSyntax> loopStatements = new List <StatementSyntax>(); //loopStatements.Add(StateHelper.MakeStatePushStatement()); loopStatements.Add(SF.ExpressionStatement( SF.AssignmentExpression( SyntaxKind.SimpleAssignmentExpression, VariableHelper.MakeStateVariableExpression(_asVariableName), SF.IdentifierName(_iteratorVariableName) ) ) ); if (_hookName != null) { loopStatements.Add(BlockContext.MakeWriteStatement(MethodCallContext.CreateMethodCall(_hookName, true))); } //loopStatements.Add(StateHelper.MakeStatePopWriteStatement()); var forEachStatement = SF.ForEachStatement(SF.ParseTypeName("var"), _iteratorVariableName, _expression, SF.Block(loopStatements)); _exitHandler(forEachStatement); }