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

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


        super.visit(that);
    }
   
    @Override
    public void visit(Tree.AnyClass that) {
        Class c = that.getDeclarationModel();
        visitDeclaration(that, c);
        Scope o = enterScope(c);
        super.visit(that);
        exitScope(o);
        if (that.getParameterList()==null) {
            that.addError("missing parameter list in class declaration: '" +
                    name(that.getIdentifier()) + "' must have a parameter list", 1000);
        }
        else {
            that.getParameterList().getModel().setFirst(true);
            c.addParameterList(that.getParameterList().getModel());
        }
        //TODO: is this still necessary??
        if (c.isClassOrInterfaceMember() &&
                c.getContainer() instanceof TypedDeclaration) {
            that.addUnsupportedError("nested classes of inner classes are not yet supported");
        }
        if (c.isAbstract() && c.isFinal()) {
            that.addError("class may not be both abstract and final: '" +
                    name(that.getIdentifier()) + "'");
        }
        if (c.isFormal() && c.isFinal()) {
            that.addError("class may not be both formal and final: '" +
                    name(that.getIdentifier()) + "'");
        }
    }
View Full Code Here


    @Override
    public void visit(Tree.ObjectDefinition that) {
        /*if (that.getClassBody()==null) {
            that.addError("missing object body");
        }*/
        Class c = new Class();
        defaultExtendedToBasic(c);
        c.setAnonymous(true);
        that.setAnonymousClass(c);
        visitDeclaration(that, c);
        Value v = new Value();
        that.setDeclarationModel(v);
        visitDeclaration(that, v);
        that.getType().setTypeModel(c.getType());
        v.setType(c.getType());
        Scope o = enterScope(c);
        super.visit(that);
        exitScope(o);
        if (c.isInterfaceMember()) {
            that.addError("object declaration may not occur directly in interface body");
        }
    }
View Full Code Here

    @Override
    public void visit(Tree.ObjectArgument that) {
        /*if (that.getClassBody()==null) {
            that.addError("missing named argument body");
        }*/
        Class c = new Class();
        defaultExtendedToBasic(c);
        c.setAnonymous(true);
        that.setAnonymousClass(c);
        visitArgument(that, c);
        Value v = new Value();
        that.setDeclarationModel(v);
        visitArgument(that, v);
        that.getType().setTypeModel(c.getType());
        v.setType(c.getType());
        Scope o = enterScope(c);
        super.visit(that);
        exitScope(o);
    }
View Full Code Here

                }
                if (len>100) {
                    length.addError("may not be greater than 100");
                    return;
                }
                Class td = unit.getTupleDeclaration();
                t = unit.getEmptyDeclaration().getType();
                for (int i=0; i<len; i++) {
                    t = producedType(td, et, et, t);
                }
            }
View Full Code Here

        that.setDeclarationModel(dec);
    }
   
    @Override
    public void visit(Tree.VoidModifier that) {
        Class vtd = unit.getAnythingDeclaration();
        if (vtd!=null) {
            that.setTypeModel(vtd.getType());
        }
    }
View Full Code Here

    }
   
    private void defaultSuperclass(Tree.ExtendedType et,
            TypeDeclaration cd) {
        if (et==null) {
            Class bd = unit.getBasicDeclaration();
            if (bd!=null) {
                cd.setExtendedType(bd.getType());
            }
        }
    }
View Full Code Here

        }
    }

    @Override
    public void visit(Tree.ObjectDefinition that) {
        Class o = that.getAnonymousClass();
        o.setExtendedType(null);
        o.getSatisfiedTypes().clear();
        defaultSuperclass(that.getExtendedType(), o);
        super.visit(that);
    }
View Full Code Here

        super.visit(that);
    }

    @Override
    public void visit(Tree.ObjectArgument that) {
        Class o = that.getAnonymousClass();
        o.setExtendedType(null);
        o.getSatisfiedTypes().clear();
        defaultSuperclass(that.getExtendedType(), o);
        super.visit(that);
    }
View Full Code Here

        super.visit(that);
    }

    @Override
    public void visit(Tree.ClassDefinition that) {
        Class cd = that.getDeclarationModel();
        cd.setExtendedType(null);
        cd.getSatisfiedTypes().clear();
        Class vd = unit.getAnythingDeclaration();
        if (vd != null && !vd.equals(cd)) {
            defaultSuperclass(that.getExtendedType(), cd);
        }
        super.visit(that);
    }
View Full Code Here

                } else if (m instanceof Method) {
                    methods.add((Method) m);
                } else if (m instanceof Interface) {
                    innerInterfaces.add((Interface) m);
                } else if (m instanceof Class) {
                    Class c = (Class) m;
                    if (Util.isThrowable(c)) {
                        innerExceptions.add(c);
                    } else {
                        innerClasses.add(c);
                    }
View Full Code Here

TOP

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

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.