Ejemplo n.º 1
0
        public override IList <Inferred> InferResult(Engine engine)
        {
            Type type = info.ReturnType;

            if (type != typeof(void))
            {
                return(Engine.MakeList(engine.InferType(info.ReturnType)));
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
        public override IList <Inferred> InferName(SymbolId name, Engine engine)
        {
            IList <Inferred> result = null;

            ReflectedModule rs;

            if (namespaces.TryGetValue(name, out rs))
            {
                result = Engine.MakeList <Inferred>(rs);
            }

            ReflectedType rt;

            if (types.TryGetValue(name, out rt))
            {
                result = Engine.Append <Inferred>(result, rt);
            }

            return(result);
        }
        public override IList <Inferred> Resolve(Engine engine, Scope scope)
        {
            Inferred         import   = engine.Import(name.Names[0]);
            IList <Inferred> previous = null;

            if (import != null)
            {
                previous = Engine.MakeList(import);

                for (int i = 1; i < name.Names.Count; i++)
                {
                    IList <Inferred> next = null;
                    foreach (Inferred inf in previous)
                    {
                        IList <Inferred> n2 = inf.InferName(name.Names[i], engine);
                        next = Engine.Union(next, n2);
                    }
                    previous = next;
                }
            }
            return(previous);
        }
 public override IList <Inferred> Resolve(Engine engine, Scope scope)
 {
     return(Engine.MakeList(engine.InferType(type)));
 }
 public override IList <Inferred> Resolve(Engine engine, Scope scope)
 {
     return(Engine.MakeList <Inferred>(new FunctionDefinitionInfo(function)));
 }
Ejemplo n.º 6
0
 private List <Inferred> InferClassDef(IronPython.Compiler.Ast.ClassDefinition node, Scope scope)
 {
     return(Engine.MakeList <Inferred>(module.GetClass(node)));
 }
Ejemplo n.º 7
0
 public override IList <FunctionInfo> InferMethods(SymbolId name)
 {
     return(Engine.MakeList <FunctionInfo>(this));
 }
Ejemplo n.º 8
0
 public override IList <Inferred> InferResult(Engine engine)
 {
     return(Engine.MakeList <Inferred>(this));
 }
Ejemplo n.º 9
0
 public override IList <Inferred> InferResult(Engine engine)
 {
     return(Engine.MakeList(engine.InferType(info.DeclaringType)));
 }
Ejemplo n.º 10
0
 public override IList <FunctionInfo> InferMethods(SymbolId name)
 {
     return(Engine.MakeList <FunctionInfo>(new ReflectedConstructorInfo(info)));
 }