C# Class Microsoft.Cci.MutableCodeModel.YieldReturnYieldBreakReplacer

Inheritance: Microsoft.Cci.MutableCodeModel.CodeRewriter
显示文件 Open project: visualmutator/visualmutator Class Usage Examples

Public Methods

Method Description
Rewrite ( IYieldBreakStatement yieldBreakStatement ) : IStatement

Replace a yield break with: { this.state = -2; return; }

Rewrite ( IYieldReturnStatement yieldReturnStatement ) : IStatement

Replace a (yield return exp)with a new block of the form: { Fresh_Label:; this.current = exp; state = Fresh_state; return true; } and associate the newly generated Fresh_state with its entry point: Fresh_label.

Private Methods

Method Description
GetStateEntries ( BlockStatement body ) : ILabeledStatement>.Dictionary

Compute the mapping between every (starting and continuing) state and their unique entry points. It does so by inserting a unique label at the entry points and associate the state with the label.

YieldReturnYieldBreakReplacer ( IteratorClosureInformation iteratorClosure, IMetadataHost host ) : Microsoft.Cci.MutableCodeModel

Method Details

Rewrite() public method

Replace a yield break with: { this.state = -2; return; }
public Rewrite ( IYieldBreakStatement yieldBreakStatement ) : IStatement
yieldBreakStatement IYieldBreakStatement
return IStatement

Rewrite() public method

Replace a (yield return exp)with a new block of the form: { Fresh_Label:; this.current = exp; state = Fresh_state; return true; } and associate the newly generated Fresh_state with its entry point: Fresh_label.
public Rewrite ( IYieldReturnStatement yieldReturnStatement ) : IStatement
yieldReturnStatement IYieldReturnStatement
return IStatement