C# Class Microsoft.Cci.MutableCodeModel.YieldReturnYieldBreakReplacer

Inheritance: Microsoft.Cci.MutableCodeModel.CodeRewriter
Afficher le fichier Open project: visualmutator/visualmutator Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

Rewrite() public méthode

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
Résultat IStatement