Package com.redhat.ceylon.compiler.typechecker.model

Examples of com.redhat.ceylon.compiler.typechecker.model.ClassOrInterface


        }
    }
   
    public void visit(Tree.SuperType that) {
        //if (inExtendsClause) { //can't appear anywhere else in the tree!
            ClassOrInterface ci = getContainingClassOrInterface(that.getScope());
            if (ci!=null) {
                if (ci.isClassOrInterfaceMember()) {
                    ClassOrInterface oci = (ClassOrInterface) ci.getContainer();
                    that.setTypeModel(intersectionOfSupertypes(oci));
                }
                else {
                    that.addError("super appears in extends for non-member class");
                }
View Full Code Here


        if (inExtends) {
            final Scope scope = that.getScope();
            ProducedType t = new LazyProducedType(unit) {
                @Override
                public TypeDeclaration initDeclaration() {
                    ClassOrInterface ci =
                            getContainingClassOrInterface(scope);
                    if (ci==null) {
                        return null;
                    }
                    else {
                        if (ci.isClassOrInterfaceMember()) {
                            ClassOrInterface oci =
                                    (ClassOrInterface) ci.getContainer();
                            return intersectionOfSupertypes(oci).getDeclaration();
                        }
                        else {
                            return null;
View Full Code Here

               
                if( type instanceof TypedDeclaration ) {
                    TypedDeclaration decl = (TypedDeclaration) type;
                    linkRenderer().to(decl).write();
                } else if( type instanceof ClassOrInterface ) {
                    ClassOrInterface klass = (ClassOrInterface) type;
                    linkRenderer().to(klass).printAbbreviated(!isAbbreviatedType(klass)).write();
                } else {
                    ProducedType pt = (ProducedType) type;
                    linkRenderer().to(pt).printAbbreviated(!isAbbreviatedType(pt.getDeclaration())).write();
                }
View Full Code Here

    private void writeInnerTypes(List<? extends TypeDeclaration> innerTypeDeclarations, String id, String title) throws IOException {
        if (!innerTypeDeclarations.isEmpty()) {
            openTable(id, title, 2, true);
            for (TypeDeclaration innerTypeDeclaration : innerTypeDeclarations) {
                if (innerTypeDeclaration instanceof ClassOrInterface) {
                    ClassOrInterface innerClassOrInterface = (ClassOrInterface) innerTypeDeclaration;
                    tool.doc(innerClassOrInterface);
                    doc(innerClassOrInterface);
                }
                if (innerTypeDeclaration instanceof TypeAlias) {
                    TypeAlias innerAlias = (TypeAlias) innerTypeDeclaration;
View Full Code Here

            if (url != null) {
                url += buildPackageUrlPath(pkg);
                url += "index.html";
            }
        } else if (to instanceof ClassOrInterface) {
            ClassOrInterface klass = (ClassOrInterface) to;
            Package pkg = getPackage(klass);
            url = getExternalModuleUrl(pkg.getModule());
            if (url != null) {
                url += buildPackageUrlPath(pkg);
                url += ceylonDocTool.getFileName(klass);
View Full Code Here

        for (Declaration decl : members) {
            if (!tool.shouldInclude(decl)) {
                continue;
            }
            if (decl instanceof ClassOrInterface) {
                ClassOrInterface classOrInterface = (ClassOrInterface) decl;
                indexMembers(classOrInterface, classOrInterface.getMembers());
            }
            if (indexDecl(container, decl)) {
                write(",\n");
            }
        }
View Full Code Here

                for (Declaration decl : pkg.getMembers()) {
                    if(!shouldInclude(decl)) {
                        continue;
                    }
                    if (decl instanceof ClassOrInterface) {
                        ClassOrInterface c = (ClassOrInterface) decl;                   
                        // subclasses map
                        if (c instanceof Class) {
                            ClassOrInterface superclass = c.getExtendedTypeDeclaration();                   
                            if (superclass != null) {
                                if (subclasses.get(superclass) ==  null) {
                                    subclasses.put(superclass, new ArrayList<Class>());
                                }
                                subclasses.get(superclass).add((Class) c);
View Full Code Here

*/
public class TypeParameterCaptureVisitor extends Visitor {
   
    @Override
    public void visit(Tree.ClassOrInterface that){
        ClassOrInterface model = that.getDeclarationModel();
        if(model != null
                && !model.isAlias()
                && !model.isToplevel()
                && !model.isMember()){
            // it's a local type, capture!
            captureTypeParameters(model);
        }
        super.visit(that);
    }
View Full Code Here

        // and they are useless at runtime
    }

    @Override
    public void visit(Tree.ClassOrInterface that){
        ClassOrInterface model = that.getDeclarationModel();
        // stop at aliases, do not collect them since we can never create any instance of them
        // and they are useless at runtime
        if(!model.isAlias())
            collect(that, model);
    }
View Full Code Here

        if(companionBuilder != null)
            companionBuilder.typeParameter(param);
    }

    public void visit(Tree.ExtendedType extendedType) {
        ClassOrInterface forDefinition = classBuilder.getForDefinition();
        classBuilder.extending(forDefinition != null ? forDefinition.getType() : null, extendedType.getType().getTypeModel());
        gen.expressionGen().transformSuperInvocation(extendedType, classBuilder);
    }
View Full Code Here

TOP

Related Classes of com.redhat.ceylon.compiler.typechecker.model.ClassOrInterface

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.