Package org.yinwang.pysonar.types

Examples of org.yinwang.pysonar.types.Type


    private Type getAttrType(@NotNull Type targetType) {
        Set<Binding> bs = targetType.table.lookupAttr(attr.id);
        if (bs == null) {
            Analyzer.self.putProblem(attr, "attribute not found in type: " + targetType);
            Type t = Type.UNKNOWN;
            t.table.setPath(targetType.table.extendPath(attr.id));
            return t;
        } else {
            addRef(targetType, bs);
            return State.makeUnion(bs);
View Full Code Here



    @NotNull
    @Override
    public Type transform(State s) {
        Type tp1 = Type.UNKNOWN;
        Type tp2 = Type.UNKNOWN;
        Type tph = Type.UNKNOWN;
        Type tpFinal = Type.UNKNOWN;

        if (handlers != null) {
            for (Handler h : handlers) {
                tph = UnionType.union(tph, transformExpr(h, s));
            }
View Full Code Here

                }
            }
        }

        boolean returned = false;
        Type retType = Type.UNKNOWN;

        for (Node n : seq) {
            Type t = transformExpr(n, state);
            if (!returned) {
                retType = UnionType.union(retType, t);
                if (!UnionType.contains(t, Type.CONT)) {
                    returned = true;
                    retType = UnionType.remove(retType, Type.CONT);
View Full Code Here


    @NotNull
    @Override
    public Type transform(State s) {
        Type ltype = transformExpr(left, s);
        Type rtype = transformExpr(right, s);

        if (Op.isBoolean(op)) {
            return Type.BOOL;
        } else {
            return UnionType.union(ltype, rtype);
View Full Code Here


    @NotNull
    @Override
    public Type transform(@NotNull State s) {
        Type type1, type2;
        State s1 = s.copy();
        State s2 = s.copy();

        // ignore condition for now
        transformExpr(test, s);
View Full Code Here

        } else if (id.equals("True") || id.equals("False")) {
            return Type.BOOL;
        } else {
            Analyzer.self.putProblem(this, "unbound variable " + id);
            Analyzer.self.unresolved.add(this);
            Type t = Type.UNKNOWN;
            t.table.setPath(s.extendPath(id));
            return t;
        }
    }
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.