C# Class Microsoft.Cci.MutableContracts.IteratorContracts.Replacer

Substitutes all field references with the expressions that are in the captured things table passed to the constructor. Also replaces locals from the MoveNext method with new locals that belong to the interator method.
Inheritance: Microsoft.Cci.MutableCodeModel.Contracts.CodeAndContractRewriter
Show file Open project: visualmutator/visualmutator

Public Methods

Method Description
Replacer ( IMetadataHost host, IExpression>.Dictionary capturedThings, IMethodDefinition iteratorMethod, IMethodDefinition moveNext ) : System
Rewrite ( IBoundExpression boundExpression ) : IExpression

If the boundExpression represents a parameter of the target method, it is replaced with the equivalent parameter of the source method.

Rewrite ( ILocalDefinition localDefinition ) : ILocalDefinition
RewriteChildren ( Microsoft.Cci.MutableCodeModel.AddressableExpression addressableExpression ) : void
RewriteChildren ( ContractElement contractElement ) : void
RewriteReference ( ILocalDefinition localDefinition ) : object

TODO: This is necessary only because the base rewriter for things like TargetExpression call this method and its definition in the base rewriter is to not visit it, but to just return it.

Method Details

Replacer() public method

public Replacer ( IMetadataHost host, IExpression>.Dictionary capturedThings, IMethodDefinition iteratorMethod, IMethodDefinition moveNext ) : System
host IMetadataHost
capturedThings IExpression>.Dictionary
iteratorMethod IMethodDefinition
moveNext IMethodDefinition
return System

Rewrite() public method

If the boundExpression represents a parameter of the target method, it is replaced with the equivalent parameter of the source method.
public Rewrite ( IBoundExpression boundExpression ) : IExpression
boundExpression IBoundExpression The bound expression.
return IExpression

Rewrite() public method

public Rewrite ( ILocalDefinition localDefinition ) : ILocalDefinition
localDefinition ILocalDefinition
return ILocalDefinition

RewriteChildren() public method

public RewriteChildren ( Microsoft.Cci.MutableCodeModel.AddressableExpression addressableExpression ) : void
addressableExpression Microsoft.Cci.MutableCodeModel.AddressableExpression
return void

RewriteChildren() public method

public RewriteChildren ( ContractElement contractElement ) : void
contractElement ContractElement
return void

RewriteReference() public method

TODO: This is necessary only because the base rewriter for things like TargetExpression call this method and its definition in the base rewriter is to not visit it, but to just return it.
public RewriteReference ( ILocalDefinition localDefinition ) : object
localDefinition ILocalDefinition
return object