internal bool Parse(BoundPointerIndirectionOperator boundPointerIndirectionOperator)
        {
            base.Parse(boundPointerIndirectionOperator);

            var boundBinaryOperator = boundPointerIndirectionOperator.Operand as BoundBinaryOperator;

            if (boundBinaryOperator != null)
            {
                this.Operand = Deserialize(boundBinaryOperator.Left) as Expression;
                var boundBinaryOperatorWithIndex = boundBinaryOperator.Right as BoundBinaryOperator;
                if (boundBinaryOperatorWithIndex != null)
                {
                    this.Index = Deserialize(boundBinaryOperatorWithIndex.Left) as Expression;
                }
                else
                {
                    var boundSizeOfOperator = boundBinaryOperator.Right as BoundSizeOfOperator;
                    if (boundSizeOfOperator != null)
                    {
                        this.Index = new Literal {
                            Value = ConstantValue.Create(1)
                        };
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            else
            {
                return(false);
            }

            var conversion = this.Index as Conversion;

            if (conversion != null && conversion.ConversionKind == ConversionKind.IntegerToPointer)
            {
                this.Index = conversion.Operand;
            }

            return(true);
        }
Example #2
0
 private void EmitPointerIndirectionOperator(BoundPointerIndirectionOperator expression, bool used)
 {
     EmitExpression(expression.Operand, used: true);
     EmitLoadIndirect(expression.Type, expression.Syntax);
     EmitPopIfUnused(used);
 }
        internal void Parse(BoundPointerIndirectionOperator pointerIndirectionOperator)
        {
            base.Parse(pointerIndirectionOperator);

            this.Operand = Deserialize(pointerIndirectionOperator.Operand) as Expression;
        }