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

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


            ((Tree.ParameterizedExpression) lhs).setLeftTerm(true);
        }
        Specification s = new Specification();
        s.setId(id++);
        visitElement(that, s);
        Scope o = enterScope(s);
        super.visit(that);
        exitScope(o);
    }
View Full Code Here


    private boolean inExtends;
   
    @Override
    public void visit(final Tree.BaseType that) {
        super.visit(that);
        final Scope scope = that.getScope();
        final String name = name(that.getIdentifier());
        if (inExtends) {
            ProducedType t = new LazyProducedType(unit) {
                @Override
                public TypeDeclaration initDeclaration() {
View Full Code Here

    }
   
    public void visit(final Tree.SuperType that) {
        super.visit(that);
        if (inExtends) {
            final Scope scope = that.getScope();
            ProducedType t = new LazyProducedType(unit) {
                @Override
                public TypeDeclaration initDeclaration() {
                    ClassOrInterface ci =
                            getContainingClassOrInterface(scope);
View Full Code Here

                }
            }
        }
        if (!list.isEmpty()) {
            if (list.size() == 1 && list.get(0).getDeclaration().isSelfType()) {
                Scope s = list.get(0).getDeclaration().getContainer();
                if (s instanceof ClassOrInterface && !((ClassOrInterface) s).isAbstract()) {
                    that.addError("non-abstract class parameterized by self type: '" +
                            td.getName() + "'", 905);
                }
            }
View Full Code Here

        } finally {
            v.classBuilder = prevClassBuilder;
            v.inInitializer = prevInInitializer;
            v.defs = prevDefs;
            // Close Substitutions which were scoped to this block
            Scope scope = block.getScope();
            while (scope instanceof ConditionScope) {
                scope = scope.getScope();
            }
            naming.closeScopedSubstitutions(scope);
        }
        return result;
    }
View Full Code Here

        last = make().If(cond, block, last);
        return last;
    }
   
    private Name getLabel(Tree.Directive dir) {
        Scope scope = dir.getScope();
        while (!(scope instanceof Package)) {
            if (scope instanceof ControlBlock) {
                Integer loopId = gen().visitor.lv.getLoopId((ControlBlock)scope);
                if (loopId != null) {
                    return names().fromString("loop_"+loopId);
                }
            }
            scope = scope.getContainer();
        }
        throw new BugException(dir, "failed to find label");
    }
View Full Code Here

        return result;
    }
   
    private String processTypedDeclaration(TypedDeclaration decl) {
        String declName = decl.getName();
        Scope declContainer = decl.getContainer();
       
        if( isLinkable(decl) ) {
            String url = getUrl(declContainer, decl);
            if( url != null ) {
                return buildLinkElement(url, getLinkText(decl), "Go to " + decl.getQualifiedNameString());
View Full Code Here

        return result;
    }
   
    private String processTypeAlias(TypeAlias alias) {
        String aliasName = alias.getName();
        Scope aliasContainer = alias.getContainer();
       
        if (isLinkable(alias)) {
            String url = getUrl(aliasContainer, alias);
            if (url != null) {
                return buildLinkElement(url, aliasName, "Go to " + alias.getQualifiedNameString());
View Full Code Here

        return getUnresolvableLink(docLinkText);
    }

    private String processAnnotationParam(String declLink) {
        String declName;
        Scope currentScope;
       
        int pkgSeparatorIndex = declLink.indexOf("::");
        if( pkgSeparatorIndex == -1 ) {
            declName = declLink;
            currentScope = resolveScope(scope);
View Full Code Here

        if( !ceylonDocTool.isIncludeNonShared() ) {
            if( !decl.isShared() ) {
                return false;
            }
           
            Scope c = decl.getContainer();
            while(c != null) {
                boolean isShared = true;
                if( c instanceof Declaration ) {
                    isShared = ((Declaration) c).isShared();
                }
                if( c instanceof Package ) {
                    isShared = ((Package) c).isShared();
                }
                if( !isShared ) {
                    return false;
                }
                c = c.getContainer();
            }
        }
        return true;
    }
View Full Code Here

TOP

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

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.