Package org.python.indexer.types

Examples of org.python.indexer.types.NUnknownType


     * Resolves and loads the module named by this qname.
     * @return the module represented by the qname up to this point.
     */
    @Override
    public NType resolve(Scope s) throws Exception {
        setType(name.setType(new NUnknownType()));

        // Check for top-level native or standard module.
        if (isUnqualified()) {
            NModuleType mt = Indexer.idx.loadModule(name.id);
            if (mt != null) {
View Full Code Here


    @Override
    protected void bindNames(Scope s) throws Exception {
        NameBinder binder = NameBinder.make();
        for (NNode target : targets) {
            binder.bind(s, target, new NUnknownType());
        }
    }
View Full Code Here

                continue// already bound by this (or another) global stmt
            }
            s.addGlobalName(name.id);
            NBinding b = moduleTable.lookup(name);
            if (b == null) {
                b = moduleTable.put(name.id, null, new NUnknownType(), NBinding.Kind.SCOPE);
            }
            Indexer.idx.putLocation(name, b);
        }
        return getType();
    }
View Full Code Here

            param.bind(funcTable, a, argtype);
            fromType.add(argtype);
        }

        if (varargs != null) {
            NType u = new NUnknownType();
            param.bind(funcTable, varargs, u);
            fromType.add(u);
        }

        if (kwargs != null) {
            NType u = new NUnknownType();
            param.bind(funcTable, kwargs, u);
            fromType.add(u);
        }

        // A lambda body is not an NBody, so it doesn't undergo the two
View Full Code Here

        if (ltype == Indexer.idx.builtins.BaseNum || rtype == Indexer.idx.builtins.BaseNum) {
            return setType(Indexer.idx.builtins.BaseNum);
        }

        if (ltype == null) {
            return setType(rtype == null ? new NUnknownType() : rtype);
        }

        if (rtype == null) {
            return setType(ltype == null ? new NUnknownType() : ltype);
        }

        return setType(NUnionType.union(ltype, rtype));
    }
View Full Code Here

        Scope scope = s.getScopeSymtab();
        resolveExpr(qname, s);

        NType bottomType = qname.getBottom().getType();
        if (!bottomType.isModuleType()) {
            return setType(new NUnknownType());
        }
        NModuleType mt = (NModuleType)bottomType;
        setType(mt);

        NImport.addReferences(s, qname, false /* don't put top name in scope */);
 
View Full Code Here

        bindNames(s, target, NameBinder.make());
    }

    private void bindNames(Scope s, NNode target, NameBinder binder) throws Exception {
        if (target instanceof NName) {
            binder.bind(s, (NName)target, new NUnknownType());
            return;
        }
        if (target instanceof NSequence) {
            for (NNode n : ((NSequence)target).getElements()) {
                bindNames(s, n, binder);
View Full Code Here

    @Override
    public NType resolve(Scope s) throws Exception {
        NameBinder.make().bindIter(s, target, iter);

        if (body == null) {
            setType(new NUnknownType());
        } else {
            setType(resolveExpr(body, s));
        }
        if (orelse != null) {
            addType(resolveExpr(orelse, s));
View Full Code Here

        if (ft.isFuncType()) {
            return setType(ft.asFuncType().getReturnType().follow());
        }

        if (ft.isUnknownType()) {
            NUnknownType to = new NUnknownType();
            NFuncType at = new NFuncType(to);
            NUnionType.union(ft, at);
            return setType(to);
        }

        addWarning("calling non-function " + ft);
        return setType(new NUnknownType());
    }
View Full Code Here

        nativeTypes.add(mt);
        return mt;
    }

    NUnknownType unknown() {
        NUnknownType t = new NUnknownType();
        nativeTypes.add(t);
        return t;
    }
View Full Code Here

TOP

Related Classes of org.python.indexer.types.NUnknownType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.