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;
        }
예제 #4
0
        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);
        }
예제 #5
0
        public Parameter(ParameterList list, string name, FullNamedExpression type, Modifier modifiers)
        {
            ParameterList = list;

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

            ParameterIndex = list.Count();
        }
예제 #6
0
 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;
 }
예제 #8
0
 public void SetType(FullNamedExpression value)
 {
     Type = value;
 }
예제 #9
0
 public Local(Block block, int index, string name, FullNamedExpression type)
     : this(block, index, name)
 {
     Type = type;
 }
예제 #10
0
        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);
        }
예제 #13
0
        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;
        }