Package org.python.indexer.types

Examples of org.python.indexer.types.NClassType


        public ItertoolsModule() {
            super("itertools");
        }
        @Override
        public void initBindings() {
            NClassType iterator = newClass("iterator", table, Object);
            iterator.getTable().update("from_iterable", liburl("itertool-functions"),
                                    newFunc(iterator), METHOD);
            iterator.getTable().update("next", liburl(), newFunc(), METHOD);

            for (String s : list("chain", "combinations", "count", "cycle",
                                 "dropwhile", "groupby", "ifilter",
                                 "ifilterfalse", "imap", "islice", "izip",
                                 "izip_longest", "permutations", "product",
View Full Code Here


        }
        @Override
        public void initBindings() {
            addNumAttrs("blocksize", "digest_size");

            NClassType md5 = newClass("md5", table, Object);
            md5.getTable().update("update", liburl(), newFunc(), METHOD);
            md5.getTable().update("digest", liburl(), newFunc(BaseStr), METHOD);
            md5.getTable().update("hexdigest", liburl(), newFunc(BaseStr), METHOD);
            md5.getTable().update("copy", liburl(), newFunc(md5), METHOD);

            update("new", liburl(), newFunc(md5), CONSTRUCTOR);
            update("md5", liburl(), newFunc(md5), CONSTRUCTOR);
        }
View Full Code Here

        public MmapModule() {
            super("mmap");
        }
        @Override
        public void initBindings() {
            NClassType mmap = newClass("mmap", table, Object);

            for (String s : list("ACCESS_COPY", "ACCESS_READ", "ACCESS_WRITE",
                                 "ALLOCATIONGRANULARITY", "MAP_ANON", "MAP_ANONYMOUS",
                                 "MAP_DENYWRITE", "MAP_EXECUTABLE", "MAP_PRIVATE",
                                 "MAP_SHARED", "PAGESIZE", "PROT_EXEC", "PROT_READ",
                                 "PROT_WRITE")) {
                mmap.getTable().update(s, liburl(), BaseNum, ATTRIBUTE);
            }

            for (String fstr : list("read", "read_byte", "readline")) {
                mmap.getTable().update(fstr, liburl(), newFunc(BaseStr), METHOD);
            }

            for (String fnum : list("find", "rfind", "tell")) {
                mmap.getTable().update(fnum, liburl(), newFunc(BaseNum), METHOD);
            }

            for (String fnone : list("close", "flush", "move", "resize", "seek",
                                     "write", "write_byte")) {
                mmap.getTable().update(fnone, liburl(), newFunc(None), METHOD);
            }

            addClass("mmap", liburl(), mmap);
        }
View Full Code Here

        public ParserModule() {
            super("parser");
        }
        @Override
        public void initBindings() {
            NClassType st = newClass("st", table, Object);
            st.getTable().update("compile", newLibUrl("parser", "st-objects"),
                                 newFunc(), METHOD);
            st.getTable().update("isexpr", newLibUrl("parser", "st-objects"),
                                 newFunc(BaseNum), METHOD);
            st.getTable().update("issuite", newLibUrl("parser", "st-objects"),
                                 newFunc(BaseNum), METHOD);
            st.getTable().update("tolist", newLibUrl("parser", "st-objects"),
                                 newFunc(newList()), METHOD);
            st.getTable().update("totuple", newLibUrl("parser", "st-objects"),
                                 newFunc(newTuple()), METHOD);

            addAttr("STType", liburl("st-objects"), Type);

            for (String s : list("expr", "suite", "sequence2st", "tuple2st")) {
View Full Code Here

        public PwdModule() {
            super("pwd");
        }
        @Override
        public void initBindings() {
            NClassType struct_pwd = newClass("struct_pwd", table, Object);
            for (String s : list("pw_nam", "pw_passwd", "pw_uid", "pw_gid",
                                 "pw_gecos", "pw_dir", "pw_shell")) {
                struct_pwd.getTable().update(s, liburl(), BaseNum, ATTRIBUTE);
            }
            addAttr("struct_pwd", liburl(), struct_pwd);

            addFunction("getpwuid", liburl(), struct_pwd);
            addFunction("getpwnam", liburl(), struct_pwd);
View Full Code Here

            };
            for (String c : constants) {
                addAttr(c, liburl("resource-limits"), BaseNum);
            }

            NClassType ru = newClass("struct_rusage", table, Object);
            String[] ru_fields = {
                "ru_utime", "ru_stime", "ru_maxrss", "ru_ixrss", "ru_idrss",
                "ru_isrss", "ru_minflt", "ru_majflt", "ru_nswap", "ru_inblock",
                "ru_oublock", "ru_msgsnd", "ru_msgrcv", "ru_nsignals",
                "ru_nvcsw", "ru_nivcsw"
            };
            for (String ruf : ru_fields) {
                ru.getTable().update(ruf, liburl("resource-usage"), BaseNum, ATTRIBUTE);
            }

            addFunction("getrusage", liburl("resource-usage"), ru);
            addFunction("getpagesize", liburl("resource-usage"), BaseNum);
View Full Code Here

            addFunction("select", liburl(), newTuple(newList(), newList(), newList()));

            String a = "edge-and-level-trigger-polling-epoll-objects";

            NClassType epoll = newClass("epoll", table, Object);
            epoll.getTable().update("close", newLibUrl("select", a), newFunc(None), METHOD);
            epoll.getTable().update("fileno", newLibUrl("select", a), newFunc(BaseNum), METHOD);
            epoll.getTable().update("fromfd", newLibUrl("select", a), newFunc(epoll), METHOD);
            for (String s : list("register", "modify", "unregister", "poll")) {
                epoll.getTable().update(s, newLibUrl("select", a), newFunc(), METHOD);
            }
            addClass("epoll", liburl(a), epoll);

            for (String s : list("EPOLLERR", "EPOLLET", "EPOLLHUP", "EPOLLIN", "EPOLLMSG",
                                 "EPOLLONESHOT", "EPOLLOUT", "EPOLLPRI", "EPOLLRDBAND",
                                 "EPOLLRDNORM", "EPOLLWRBAND", "EPOLLWRNORM")) {
                addAttr(s, liburl(a), BaseNum);
            }

            a = "polling-objects";

            NClassType poll = newClass("poll", table, Object);
            poll.getTable().update("register", newLibUrl("select", a), newFunc(), METHOD);
            poll.getTable().update("modify", newLibUrl("select", a), newFunc(), METHOD);
            poll.getTable().update("unregister", newLibUrl("select", a), newFunc(), METHOD);
            poll.getTable().update("poll", newLibUrl("select", a),
                                   newFunc(newList(newTuple(BaseNum, BaseNum))), METHOD);
            addClass("poll", liburl(a), poll);

            for (String s : list("POLLERR", "POLLHUP", "POLLIN", "POLLMSG",
                                 "POLLNVAL", "POLLOUT","POLLPRI", "POLLRDBAND",
                                 "POLLRDNORM", "POLLWRBAND", "POLLWRNORM")) {
                addAttr(s, liburl(a), BaseNum);
            }

            a = "kqueue-objects";

            NClassType kqueue = newClass("kqueue", table, Object);
            kqueue.getTable().update("close", newLibUrl("select", a), newFunc(None), METHOD);
            kqueue.getTable().update("fileno", newLibUrl("select", a), newFunc(BaseNum), METHOD);
            kqueue.getTable().update("fromfd", newLibUrl("select", a), newFunc(kqueue), METHOD);
            kqueue.getTable().update("control", newLibUrl("select", a),
                                   newFunc(newList(newTuple(BaseNum, BaseNum))), METHOD);
            addClass("kqueue", liburl(a), kqueue);

            a = "kevent-objects";

            NClassType kevent = newClass("kevent", table, Object);
            for (String s : list("ident", "filter", "flags", "fflags", "data", "udata")) {
                kevent.getTable().update(s, newLibUrl("select", a), unknown(), ATTRIBUTE);
            }
            addClass("kevent", liburl(a), kevent);
        }
View Full Code Here

        return newClass(name, table, null);
    }

    NClassType newClass(String name, Scope table,
                        NClassType superClass, NClassType... moreSupers) {
        NClassType t = new NClassType(name, table, superClass);
        for (NClassType c : moreSupers) {
            t.addSuper(c);
        }
        nativeTypes.add(t);
        return t;
    }
View Full Code Here

        public Bz2Module() {
            super("bz2");
        }
        @Override
        public void initBindings() {
            NClassType bz2 = newClass("BZ2File", table, BaseFile)// close enough.
            addClass("BZ2File", liburl(), bz2);

            NClassType bz2c = newClass("BZ2Compressor", table, Object);
            bz2c.getTable().update("compress", newLibUrl("bz2", "sequential-de-compression"),
                                   newFunc(BaseStr), METHOD);
            bz2c.getTable().update("flush", newLibUrl("bz2", "sequential-de-compression"),
                                   newFunc(None), METHOD);
            addClass("BZ2Compressor", newLibUrl("bz2", "sequential-de-compression"), bz2c);

            NClassType bz2d = newClass("BZ2Decompressor", table, Object);
            bz2d.getTable().update("decompress", newLibUrl("bz2", "sequential-de-compression"),
                                   newFunc(BaseStr), METHOD);
            addClass("BZ2Decompressor", newLibUrl("bz2", "sequential-de-compression"), bz2d);

            addFunction("compress", newLibUrl("bz2", "one-shot-de-compression"), BaseStr);
            addFunction("decompress", newLibUrl("bz2", "one-shot-de-compression"), BaseStr);
View Full Code Here

        public void initBindings() {
            addUnknownFuncs("dump", "load", "dumps", "loads");

            addClass("PickleError", liburl(), newException("PickleError", table));

            NClassType picklingError = newException("PicklingError", table);
            addClass("PicklingError", liburl(), picklingError);
            update("UnpickleableError", liburl(),
                   newClass("UnpickleableError", table, picklingError), CLASS);
            NClassType unpicklingError = newException("UnpicklingError", table);
            addClass("UnpicklingError", liburl(), unpicklingError);
            update("BadPickleGet", liburl(),
                   newClass("BadPickleGet", table, unpicklingError), CLASS);

            NClassType pickler = newClass("Pickler", table, Object);
            pickler.getTable().update("dump", liburl(), newFunc(), METHOD);
            pickler.getTable().update("clear_memo", liburl(), newFunc(), METHOD);
            addClass("Pickler", liburl(), pickler);

            NClassType unpickler = newClass("Unpickler", table, Object);
            unpickler.getTable().update("load", liburl(), newFunc(), METHOD);
            unpickler.getTable().update("noload", liburl(), newFunc(), METHOD);
            addClass("Unpickler", liburl(), unpickler);
        }
View Full Code Here

TOP

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

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.