Examples of CeylonCompilationUnit


Examples of com.redhat.ceylon.compiler.java.codegen.CeylonCompilationUnit

         * Here we convert the ceylon tree to its javac AST, after the typechecker has run
         */
        Timer nested = timer.nestedTimer();
        for (JCCompilationUnit tree : trees) {
            if (tree instanceof CeylonCompilationUnit) {
                CeylonCompilationUnit ceylonTree = (CeylonCompilationUnit) tree;
                gen.setMap(ceylonTree.lineMap);
                CeylonPhasedUnit phasedUnit = (CeylonPhasedUnit)ceylonTree.phasedUnit;
                gen.setFileObject(phasedUnit.getFileObject());
                nested.startTask("Ceylon code generation for " + phasedUnit.getUnitFile().getName());
                TaskEvent event = new TaskEvent(TaskEvent.Kind.PARSE, tree);
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.codegen.CeylonCompilationUnit

                }
            }
            JCCompilationUnit javaCompilationUnit = parse(fileObject);
            Module module;
            if(javaCompilationUnit instanceof CeylonCompilationUnit){
                CeylonCompilationUnit ceylonCompilationUnit = (CeylonCompilationUnit) javaCompilationUnit;
                moduleTrees.add(ceylonCompilationUnit);
                // parse the module info from there
                module = ceylonCompilationUnit.phasedUnit.visitSrcModulePhase();
                ceylonCompilationUnit.phasedUnit.visitRemainingModulePhase();
                // now set the module
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.codegen.CeylonCompilationUnit

            final Names names) {
        for(Object treeHolder : treeHolders){
            if (!(treeHolder instanceof CeylonCompilationUnit)) {
                continue;
            }
            final CeylonCompilationUnit tree = (CeylonCompilationUnit)treeHolder;
            CompilationUnit ceylonTree = tree.ceylonTree;
            final String pkgName = tree.getPackageName() != null ? Util.quoteJavaKeywords(tree.getPackageName().toString()) : "";
            ceylonTree.visit(new SourceDeclarationVisitor(){
                @Override
                public void loadFromSource(Declaration decl) {
                    if(isNative(decl))
                        return;
                    String fqn = Naming.toplevelClassName(pkgName, decl);
                    try{
                        reader.enterClass(names.fromString(fqn), tree.getSourceFile());
                    }catch(AssertionError error){
                        // this happens when we have already registered a source file for this decl, hopefully the typechecker
                        // will catch this and log an error
                    }
                }

                @Override
                public void loadFromSource(ModuleDescriptor that) {
                    try{
                        reader.enterClass(names.fromString(pkgName + "." +Naming.MODULE_DESCRIPTOR_CLASS_NAME), tree.getSourceFile());
                    }catch(AssertionError error){
                        // this happens when we have already registered a source file for this decl, hopefully the typechecker
                        // will catch this and log an error
                    }
                }

                @Override
                public void loadFromSource(PackageDescriptor that) {
                    try{
                        reader.enterClass(names.fromString(pkgName + "." +Naming.PACKAGE_DESCRIPTOR_CLASS_NAME), tree.getSourceFile());
                    }catch(AssertionError error){
                        // this happens when we have already registered a source file for this decl, hopefully the typechecker
                        // will catch this and log an error
                    }
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.