public Local DeclareLocal(string name, FullNamedExpression type)
        {
            var entry = new Local(Block, Locals.Count, name, type);
            Locals.Add(entry);

            return entry;
        }
 public MethodCallOrArrayDereference(Statement statement, FullNamedExpression member, Expression[] args,
                                     SourceData sourceData)
     : base(statement, sourceData)
 {
     // TODO: Complete member initialization
     Member = member;
     Arguments = args;
 }
        protected PropertyDef(ClassStructOrModuleDef parent, string name, FullNamedExpression propertyType,
                              ParameterList parameters, bool isIndexer, Modifier modifiers)
            : base(parent, name, modifiers)
        {
            PropertyType = propertyType;
            IsIndexedProperty = isIndexer;

            this.parameters = parameters;
        }
        public MethodDef(ClassStructOrModuleDef parent, string name, FullNamedExpression returnType, ParameterList param,
                         Modifier modifiers)
            : base(parent, new MemberName(parent.MemberName, Separators.DoubleColon, name), modifiers)
        {
            ReturnType = returnType;
            Parameters = param;

            parent.AddMethod(this);
        }
        public Parameter(ParameterList list, string name, FullNamedExpression type, Modifier modifiers)
        {
            ParameterList = list;

            Name = name;
            Type = type;
            Modifiers = modifiers;

            ParameterIndex = list.Count();
        }
 public FieldDef(TypeDef parent, string name, FullNamedExpression type, Modifier modifiers)
     : base(parent, new MemberName(parent.MemberName, Separators.DoubleColon, name), modifiers)
 {
     FieldType = type;
 }
 public void SetType(FullNamedExpression type)
 {
     Type = type;
 }
 public void SetType(FullNamedExpression value)
 {
     Type = value;
 }
 public Local(Block block, int index, string name, FullNamedExpression type)
     : this(block, index, name)
 {
     Type = type;
 }
        public IVariable ResolveVariableName(FullNamedExpression var)
        {
            string str = var.ToString();

            IVariable r = LocalScope.GetVariable(str);

            if (r != null) return r;

            return Method.Parent.Fields.First(x => x.Name == str);
        }
 public static PropertyDef CreateIndexedProperty(ClassStructOrModuleDef parent, string name,
                                                 FullNamedExpression propertyType, ParameterList parameters,
                                                 Modifier modifiers)
 {
     return new PropertyDef(parent, name, propertyType, parameters, true, modifiers);
 }
        public static PropertyDef CreateProperty(ClassStructOrModuleDef parent, string name,
                                                 FullNamedExpression propertyType, Parameter parameter,
                                                 Modifier modifiers)
        {
            var plist = new ParameterList();
            plist.Add(parameter);

            return new PropertyDef(parent, name, propertyType, plist, false, modifiers);
        }
        public IMethodDefinition ResolveMethodName(FullNamedExpression fullNamedExpression,
                                                   params ITypeDefinition[] parameterTypes)
        {
            if (fullNamedExpression.NumberOfParts == 1)
            {
                string val = fullNamedExpression.GetName(false);
                //var t = TypeManager.ResolveType(fullNamedExpression);
                IMethodDefinition[] methods = Parent.GetMethods();

                IEnumerable<IMethodDefinition> r = methods.Where(x => x.Name == val);

                if (r.Count() > 1)
                {
                    //Ambiguous 

                    return null;
                }

                //r = r.Where(x => x.GetParameters()

                //if(r.Count() == 0)
                //{

                //}

                return r.ElementAt(0);
            }

            return null;
        }