Package org.cx4a.rsense.typing.annotation

Examples of org.cx4a.rsense.typing.annotation.ClassType


        return tag != null ? tag.getType() : null;
    }
   
    public static void setClassTag(RubyModule klass, Node node, List<TypeAnnotation> annotations) {
        if (getClassAnnotation(klass) == null) {
            ClassType type = null;
            for (TypeAnnotation annot : annotations) {
                if (annot instanceof ClassType) {
                    type = (ClassType) annot;
                    break;
                }
View Full Code Here


    public ObjectAllocator() {
        instances = new HashMap<RubyClass, IRubyObject>();
    }

    public IRubyObject allocate(Ruby runtime, RubyClass klass) {
        ClassType classType = RuntimeHelper.getClassAnnotation(klass);
        if (classType != null && classType.isPolymorphic()) {
            return newPolymorphicInstance(runtime, klass, classType);
        } else {
            return newMonomorphicInstance(runtime, klass);
        }
    }
View Full Code Here

    }

    public Result resolveMethodAnnotation(Template template) {
        Method method = template.getMethod();
        if (method.getAnnotations() != null) {
            ClassType classType = RuntimeHelper.getEnclosingClassAnnotation(method.getModule());
            TemplateAttribute attr = template.getAttribute();
            IRubyObject receiver = attr.getMutableReceiver();
            IRubyObject[] args = attr.getMutableArgs();
            Vertex returnVertex = template.getReturnVertex();
View Full Code Here

            IRubyObject ret = resolveIdentity(template, app.getIdentity());
            if (!(ret instanceof RubyModule) || !arg.isKindOf((RubyModule) ret)) {
                return false;
            } else {
                RubyModule klass = (RubyModule) ret;
                ClassType klassType = RuntimeHelper.getClassAnnotation(klass);
                TypeVarMap typeVarMap = RuntimeHelper.getTypeVarMap(arg);
                if (klassType != null && typeVarMap != null) {
                    List<TypeVariable> vars = klassType.getTypes();
                    for (int i = 0; i < vars.size(); i++) {
                        TypeVariable var = vars.get(i);
                        Vertex vertex = typeVarMap.get(var);
                        if (i < types.size() && vertex != null) {
                            TypeExpression expr = types.get(i);
View Full Code Here

            List<TypeExpression> types = app.getTypes();
            IRubyObject ret = resolveIdentity(template, app.getIdentity());
            if (ret != null && ret instanceof RubyClass) {
                RubyClass klass = (RubyClass) ret;
                ret = graph.newInstanceOf(klass);
                ClassType klassType = RuntimeHelper.getClassAnnotation(klass);
                TypeVarMap typeVarMap = RuntimeHelper.getTypeVarMap(ret);
                if (klassType != null && typeVarMap != null) {
                    List<TypeVariable> vars = klassType.getTypes();
                    for (int i = 0; i < vars.size(); i++) {
                        TypeVariable var = vars.get(i);
                        if (i < types.size()) {
                            TypeExpression expr = types.get(i);
                            TypeSet ts = processMethodReturn(template, classType, expr, receiver);
View Full Code Here

TOP

Related Classes of org.cx4a.rsense.typing.annotation.ClassType

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.