Package org.yinwang.pysonar.types

Examples of org.yinwang.pysonar.types.Type


                }
            } else {
                funkind = Binding.Kind.FUNCTION;
            }

            Type outType = s.type;
            if (outType instanceof ClassType) {
                fun.setCls((ClassType) outType);
            }

            Binder.bind(s, name, fun, funkind);
View Full Code Here



    @NotNull
    @Override
    public Type transform(@NotNull State s) {
        Type valueType = transformExpr(value, s);
        Binder.bind(s, target, valueType);
        return Type.CONT;
    }
View Full Code Here

    @NotNull
    @Override
    public Type transform(@NotNull State s) {
        Binder.bindIter(s, target, iter, Binding.Kind.SCOPE);

        Type ret;
        if (body == null) {
            ret = Type.UNKNOWN;
        } else {
            ret = transformExpr(body, s);
        }
View Full Code Here

     * return the union of their types.  If {@code nodes} is empty or
     * {@code null}, returns a new {@link org.yinwang.pysonar.types.UnknownType}.
     */
    @NotNull
    protected Type resolveUnion(@NotNull Collection<? extends Node> nodes, State s) {
        Type result = Type.UNKNOWN;
        for (Node node : nodes) {
            Type nodeType = transformExpr(node, s);
            result = UnionType.union(result, nodeType);
        }
        return result;
    }
View Full Code Here

     * @return a list of entries constituting the file outline.
     * Returns an empty list if the analyzer hasn't analyzed that path.
     */
    @NotNull
    public List<Entry> generate(@NotNull Analyzer idx, @NotNull String abspath) {
        Type mt = idx.loadFile(abspath);
        if (mt == null) {
            return new ArrayList<>();
        }
        return generate(mt.table, abspath);
    }
View Full Code Here

        for (Binding nb : entries) {
            List<Entry> kids = null;

            if (nb.kind == Binding.Kind.CLASS) {
                Type realType = nb.type;
                if (realType instanceof UnionType) {
                    for (Type t : ((UnionType) realType).types) {
                        if (t instanceof ClassType) {
                            realType = t;
                            break;
View Full Code Here


    @NotNull
    @Override
    public Type transform(State s) {
        Type keyType = resolveUnion(keys, s);
        Type valType = resolveUnion(values, s);
        return new DictType(keyType, valType);
    }
View Full Code Here

    @NotNull
    @Override
    public Type transform(State s) {
        transformExpr(test, s);
        Type t = Type.UNKNOWN;

        if (body != null) {
            t = transformExpr(body, s);
        }
View Full Code Here

        addChildren(target, attr);
    }


    public void setAttr(State s, @NotNull Type v) {
        Type targetType = transformExpr(target, s);
        if (targetType instanceof UnionType) {
            Set<Type> types = ((UnionType) targetType).types;
            for (Type tp : types) {
                setAttrType(tp, v);
            }
View Full Code Here

        // the form of ::A in ruby
        if (target == null) {
            return transformExpr(attr, s);
        }

        Type targetType = transformExpr(target, s);
        if (targetType instanceof UnionType) {
            Set<Type> types = ((UnionType) targetType).types;
            Type retType = Type.UNKNOWN;
            for (Type tt : types) {
                retType = UnionType.union(retType, getAttrType(tt));
            }
            return retType;
        } else {
View Full Code Here

TOP

Related Classes of org.yinwang.pysonar.types.Type

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.