public override void Visit(IBoundExpression boundExpression) { //if (boundExpression.Instance != null) //{ // this.Visit(boundExpression.Instance); // // TODO: (mschaef) look where it's bound and do something //} #region LocalDefinition ILocalDefinition local = boundExpression.Definition as ILocalDefinition; if (local != null) { TranslatedExpressions.Push(Bpl.Expr.Ident(this.sink.FindOrCreateLocalVariable(local))); return; } #endregion #region ParameterDefiniton IParameterDefinition param = boundExpression.Definition as IParameterDefinition; if (param != null) { TranslatedExpressions.Push(Bpl.Expr.Ident(this.sink.FindParameterVariable(param))); return; } #endregion #region FieldDefinition IFieldReference field = boundExpression.Definition as IFieldReference; if (field != null) { if (boundExpression.Instance != null) { ProcessFieldVariable(field, boundExpression.Instance,true); return; } else { throw new NotImplementedException(String.Format("Field {0} with Instance NULL.", boundExpression.ToString())); } } #endregion #region PropertyDefinition IPropertyDefinition prop = boundExpression.Definition as IPropertyDefinition; if (prop != null) { throw new NotImplementedException("Properties are not implemented"); } #endregion #region ArrayIndexer IArrayIndexer/*?*/ indexer = boundExpression.Definition as IArrayIndexer; if (indexer != null) { this.Visit(indexer); return; } #endregion #region AddressDereference IAddressDereference/*?*/ deref = boundExpression.Definition as IAddressDereference; if (deref != null) { IAddressOf/*?*/ addressOf = deref.Address as IAddressOf; if (addressOf != null) { this.Visit(addressOf.Expression); return; } if (boundExpression.Instance != null) { // TODO this.Visit(boundExpression.Instance); Console.Write("->"); } else if (deref.Address.Type is IPointerTypeReference) Console.Write("*"); this.Visit(deref.Address); return; } else { if (boundExpression.Instance != null) { throw new NotImplementedException("Addr DeRef without instance."); } } #endregion }