Exemplo n.º 1
0
        public override void Visit(PostfixExpression_Access acc)
        {
            acc.PostfixForeExpression.Accept(this);

            if ((acc.AccessExpression is IdentifierExpression &&
                 (acc.AccessExpression as IdentifierExpression).ValueStringHash != searchHash) ||
                (acc.AccessExpression is TemplateInstanceExpression &&
                 ((TemplateInstanceExpression)acc.AccessExpression).TemplateIdHash != searchHash))
            {
                return;
            }
            else if (acc.AccessExpression is NewExpression)
            {
                var nex = acc.AccessExpression as NewExpression;

                if ((nex.Type is IdentifierDeclaration &&
                     ((IdentifierDeclaration)nex.Type).IdHash != searchHash) ||
                    (nex.Type is TemplateInstanceExpression &&
                     ((TemplateInstanceExpression)acc.AccessExpression).TemplateIdHash != searchHash))
                {
                    return;
                }
                // Are there other types to test for?
            }
            else
            {
                // Are there other types to test for?
            }

            ctxt.CurrentContext.Set(acc.Location);
            var ov = ExpressionTypeEvaluation.GetAccessedOverloads(acc, ctxt, null, false);

            if (ov == null)
            {
                return;
            }

            foreach (var o in ov)
            {
                if (TryAdd(o, acc.AccessExpression))
                {
                    return;
                }
            }
        }