示例#1
0
        public override Node ExitFunctionCallExpression(Production node)
        {
            IList childValues = this.GetChildValues(node);
            var   name        = (string)childValues[0];

            childValues.RemoveAt(0);
            var args     = new ArgumentList(childValues);
            var funcCall = new FunctionCallElement(name, args);

            node.AddValue(funcCall);
            return(node);
        }
示例#2
0
        private bool FindIndexer(Type targetType)
        {
            var members = targetType.GetDefaultMembers();
            var methods = new List <MethodInfo>();
            var array   = members;

            checked
            {
                for (var i = 0; i < array.Length; i++)
                {
                    var mi   = array[i];
                    var pi   = mi as PropertyInfo;
                    var flag = pi != null;
                    if (flag)
                    {
                        methods.Add(pi.GetGetMethod(true));
                    }
                }
                var func = new FunctionCallElement("Indexer", methods.ToArray(), this.myIndexerElements);
                func.Resolve(this.myServices);
                this.myIndexerElement = func;
                return(true);
            }
        }