Ejemplo n.º 1
0
            private void PushFieldValueForTarget(Ast.FieldReferenceExpression node, Ast.Expression target)
            {
                switch (target.CodeElementType)
                {
                case Ast.CodeElementType.ArgumentReferenceExpression:
                    PushFieldValue(CandidateFieldRoot.Instance, node.Field);
                    break;

                case Ast.CodeElementType.ThisReferenceExpression:
                    if (InsideCandidate)
                    {
                        if (_current != null)
                        {
                            var current = PopFieldValue(node);
                            PushFieldValue(current, node.Field);
                        }
                        else
                        {
                            PushFieldValue(CandidateFieldRoot.Instance, node.Field);
                        }
                    }
                    else
                    {
                        PushFieldValue(PredicateFieldRoot.Instance, node.Field);
                    }
                    break;

                case Ast.CodeElementType.MethodInvocationExpression:
                case Ast.CodeElementType.FieldReferenceExpression:
                    var value = ToFieldValue(target);
                    PushFieldValue(value, node.Field);
                    break;

                case Ast.CodeElementType.CastExpression:
                    PushFieldValueForTarget(node, ((Ast.CastExpression)node.Target).Target);
                    break;

                default:
                    UnsupportedExpression(node);
                    break;
                }
            }
Ejemplo n.º 2
0
 public override void Visit(Ast.FieldReferenceExpression node)
 {
     PushFieldValueForTarget(node, node.Target);
 }