private Expression ParseArrayElementAddres(IOperation currentOperation, ITypeReference elementType, bool treatArrayAsSingleDimensioned = false) {
   Contract.Requires(currentOperation != null);
   Contract.Requires(elementType != null);
   AddressOf result = new AddressOf();
   result.ObjectControlsMutability = this.sawReadonly;
   AddressableExpression addressableExpression = new AddressableExpression();
   result.Expression = addressableExpression;
   ArrayIndexer indexer = this.ParseArrayIndexer(currentOperation, elementType, treatArrayAsSingleDimensioned);
   addressableExpression.Definition = indexer;
   addressableExpression.Instance = indexer.IndexedObject;
   addressableExpression.Type = elementType;
   this.sawReadonly = false;
   return result;
 }
Esempio n. 2
0
 private Expression ParseArrayElementAddres(IOperation currentOperation)
 {
     AddressOf result = new AddressOf();
       result.ObjectControlsMutability = this.sawReadonly;
       AddressableExpression addressableExpression = new AddressableExpression();
       result.Expression = addressableExpression;
       ArrayIndexer indexer = this.ParseArrayIndexer(currentOperation);
       addressableExpression.Definition = indexer;
       addressableExpression.Instance = indexer.IndexedObject;
       this.sawReadonly = false;
       return result;
 }
Esempio n. 3
0
 /// <summary>
 /// Visits the specified address of.
 /// </summary>
 /// <param name="addressOf">The address of.</param>
 /// <returns></returns>
 protected virtual IExpression DeepCopy(AddressOf addressOf)
 {
     addressOf.Expression = (IAddressableExpression)this.Substitute(addressOf.Expression);
       addressOf.Type = this.Substitute(addressOf.Type);
       return addressOf;
 }
Esempio n. 4
0
 /// <summary>
 /// Visits the specified address of.
 /// </summary>
 /// <param name="addressOf">The address of.</param>
 public override void Visit(IAddressOf addressOf)
 {
     AddressOf mutableAddressOf = new AddressOf(addressOf);
     this.resultExpression = this.myCodeCopier.DeepCopy(mutableAddressOf);
 }
Esempio n. 5
0
 /// <summary>
 /// Rewrites the children of the given AddressOf expression.
 /// </summary>
 /// <param name="addressOf"></param>
 public virtual void RewriteChildren(AddressOf addressOf)
 {
     this.RewriteChildren((Expression)addressOf);
       addressOf.Expression = this.Rewrite((AddressableExpression)addressOf.Expression);
 }
Esempio n. 6
0
 /// <summary>
 /// Visits the specified address of.
 /// </summary>
 /// <param name="addressOf">The address of.</param>
 public override void Visit(IAddressOf addressOf)
 {
     AddressOf mutableAddressOf = addressOf as AddressOf;
     if (alwaysMakeACopy || mutableAddressOf == null) mutableAddressOf = new AddressOf(addressOf);
     this.resultExpression = this.myCodeMutator.Visit(mutableAddressOf);
 }
Esempio n. 7
0
 /// <summary>
 /// Visits the specified address of.
 /// </summary>
 /// <param name="addressOf">The address of.</param>
 /// <returns></returns>
 public virtual IExpression Visit(AddressOf addressOf)
 {
     addressOf.Expression = this.Visit(addressOf.Expression);
       addressOf.Type = this.Visit(addressOf.Type);
       return addressOf;
 }