Package com.redhat.ceylon.compiler.typechecker.tree

Examples of com.redhat.ceylon.compiler.typechecker.tree.Visitor


                for (Map.Entry<Module,JsOutput> e : output.entrySet()) {
                    e.getValue().encodeModel(names);
                }
            }
            //Output all the require calls for any imports
            final Visitor importVisitor = new Visitor() {
                public void visit(Tree.Import that) {
                    ImportableScope scope =
                            that.getImportMemberOrTypeList().getImportList().getImportedScope();
                    Module _m = that.getUnit().getPackage().getModule();
                    if (scope instanceof Package && !((Package)scope).getModule().equals(_m)) {
View Full Code Here


            final boolean warnAboutUnknownWarnings) {
        if (anno == null) {
            return Collections.emptyMap();
        }
        final Map<E, Tree.StringLiteral> suppressed = new HashMap<E, Tree.StringLiteral>(2);
        anno.visit(new Visitor() {
            public void visit(Tree.StringLiteral that) {
                String warningName = that.getText();
                E warning = parseName(warningName);
                if (warning == null) {
                    if (warnAboutUnknownWarnings) {
View Full Code Here

                                        unit.getFullPath() + " and " + u.getFullPath());
                    }
                }
            }
            compilationUnit.visit(new Validator());
            compilationUnit.visit(new Visitor() {
                @Override
                public void visit(ModuleDescriptor that) {
                    super.visit(that);
                    ImportPath importPath = that.getImportPath();
                    if (importPath != null) {
View Full Code Here

        }
        else if (that instanceof Tree.InitializerParameter) {
            sie = ((Tree.InitializerParameter) that).getSpecifierExpression();
        }
        if (sie!=null) {
            new Visitor() {
                public void visit(Tree.AssignmentOp that) {
                    that.addError("assignment may not occur in default argument expression");
                }
                @Override
                public void visit(Tree.PostfixOperatorExpression that) {
View Full Code Here

   
    private Tree.DocLink findDocLink(final String docLinkText, Referenceable referenceable) {
        final Tree.DocLink[] docLinks = new Tree.DocLink[1];
        Node scopeNode = ceylonDocTool.getNode(referenceable);
        if (scopeNode != null) {
            scopeNode.visit(new Visitor() {
                @Override
                public void visit(Tree.DocLink docLink) {
                    String s1 = normalizeSpaces(docLinkText);
                    String s2 = normalizeSpaces(docLink.getText());
                    if (s1.equals(s2)) {
View Full Code Here

    }

    private void buildNodesMaps() {
        for (final PhasedUnit pu : phasedUnits) {
            CompilationUnit cu = pu.getCompilationUnit();
            Walker.walkCompilationUnit(new Visitor() {
                public void visit(Tree.Declaration that) {
                    modelUnitMap.put(that.getDeclarationModel(), pu);
                    modelNodeMap.put(that.getDeclarationModel(), that);
                    super.visit(that);
                }
View Full Code Here

                }
            }
        }
       
        final List<ProducedType> thrownExceptions = new ArrayList<ProducedType>();
        node.visitChildren(new Visitor() {
            @Override
            public void visit(Tree.Throw that) {
                Expression expression = that.getExpression();
                if (expression != null) {
                    thrownExceptions.add(expression.getTypeModel());
View Full Code Here

            for (Parameter parameter : parameterList.getParameters()) {
                parametersNames.put(parameter.getName(), parameter);
            }
        }

        body.visitChildren(new Visitor() {

            private boolean stop = false;
            private Tree.Assertion assertion = null;
            private Set<Parameter> referencedParameters = new HashSet<Parameter>();
View Full Code Here

            // Unfortunately doing it like this
            final Map<String, List<String>> testMethods = new TreeMap<String, List<String>>();

            for (PhasedUnit pu : phasedUnits.getPhasedUnits()) {
                CompilationUnit cu = pu.getCompilationUnit();
                cu.visit(new Visitor() {
                    private String testClassName = null;
                    @Override
                    public void visit(Declaration that) {
                        if (that instanceof AnyClass
                                && ((AnyClass)that).getDeclarationModel().getName().endsWith("Test")
View Full Code Here

    public static Tree.TypedDeclaration getMemberDeclaration(Tree.AnyClass def, final Tree.Parameter parameter) {
        if (parameter instanceof Tree.ParameterDeclaration) {
            return ((Tree.ParameterDeclaration)parameter).getTypedDeclaration();
        } else if (parameter instanceof Tree.InitializerParameter) {
            final Tree.TypedDeclaration[] annotationList = new Tree.TypedDeclaration[]{null};
            def.visit(new Visitor() {
                public void visit(Tree.MethodDeclaration that) {
                    if (that.getDeclarationModel().equals(parameter.getParameterModel().getModel())) {
                        annotationList[0] = that;
                    }
                }
View Full Code Here

TOP

Related Classes of com.redhat.ceylon.compiler.typechecker.tree.Visitor

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.