Microsoft.Cci.MutableCodeModel.YieldReturnYieldBreakReplacer.GetStateEntries C# (CSharp) Метод

GetStateEntries() приватный Метод

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.
private GetStateEntries ( BlockStatement body ) : ILabeledStatement>.Dictionary
body BlockStatement
Результат ILabeledStatement>.Dictionary
    internal Dictionary<int, ILabeledStatement> GetStateEntries(BlockStatement body) {
      BlockStatement blockStatement = body;
      stateEntries = new Dictionary<int, ILabeledStatement>();
      LabeledStatement initialLabel = new LabeledStatement() {
        Label = this.host.NameTable.GetNameFor("Label"+ this.stateNumber++), Statement = new EmptyStatement()
      };
      // O(n), but happen only once. 
      blockStatement.Statements.Insert(0, initialLabel);
      stateEntries.Add(0, initialLabel);
      this.stateNumber = 1;
      this.RewriteChildren(blockStatement);
      this.stateNumber = 0;
      Dictionary<int, ILabeledStatement> result = stateEntries;
      stateEntries = null;
      return result;
    }