Examples of CeylonFileObject


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

        }
        for(PhasedUnit phasedUnit : phasedUnits.getPhasedUnits()){
            for(Tree.ModuleDescriptor modDescr : phasedUnit.getCompilationUnit().getModuleDescriptors()){
                String name = phasedUnit.getPackage().getNameAsString();
                CeylonPhasedUnit cpu = (CeylonPhasedUnit) phasedUnit;
                CeylonFileObject cfo = (CeylonFileObject) cpu.getFileObject();
                moduleNamesToFileObjects .put(name, cfo);
            }
        }
    }
View Full Code Here

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

    public boolean getTreatLikelyBugsAsErrors() {
        return treatLikelyBugsAsErrors;
    }
   
    private JavaFileObject genCodeUnlessError(Env<AttrContext> env, JCClassDecl cdef) throws IOException {
        CeylonFileObject sourcefile = (CeylonFileObject) env.toplevel.sourcefile;
        try {
            // do not look at the global number of errors but only those for this file
            if (super.gen.genClass(env, cdef)){
                String packageName = cdef.sym.packge().getQualifiedName().toString();
                Package pkg = modelLoader.findPackage(packageName);
                if(pkg == null)
                    throw new RuntimeException("Failed to find package: "+packageName);
                Module module = pkg.getModule();
                if(!module.isDefault()){
                    String moduleName = module.getNameAsString();
                    CeylonFileObject moduleFileObject = moduleNamesToFileObjects.get(moduleName);
                    // if there's no module source file object it means the module descriptor had parse errors
                    if(moduleFileObject == null || moduleFileObject.hasError()){
                        // we do not produce any class files for modules with errors
                        if(options.get(OptionName.VERBOSE) != null){
                            Log.printLines(log.noticeWriter, "[Not writing class "+cdef.sym.className()
                                    +" because its module has errors: "+moduleName+"]");
                        }
View Full Code Here

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

        Iterable<? extends JavaFileObject> theCollection = super.getJavaFileObjectsFromFiles(files);
        ArrayList<JavaFileObject> result = new ArrayList<JavaFileObject>();
        for (JavaFileObject file : theCollection) {
            if (file.getName().endsWith(".ceylon")) {
                result.add(new CeylonFileObject(file));
            } else {
                result.add(file);
            }
        }
        return result;
View Full Code Here

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

    public Iterable<JavaFileObject> list(Location location, String packageName, Set<JavaFileObject.Kind> kinds, boolean recurse) throws IOException {
        Iterable<JavaFileObject> result = super.list(location, packageName, kinds, recurse);
        ListBuffer<JavaFileObject> buf = new ListBuffer<JavaFileObject>();
        for (JavaFileObject f : result) {
            if (f.getName().endsWith(".ceylon")) {
                buf.add(new CeylonFileObject(f));
            } else {
                buf.add(f);
            }
        }
        return buf.toList();
View Full Code Here

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

        return buf.toList();
    }

    public String inferBinaryName(Location location, JavaFileObject file) {
        if (file instanceof CeylonFileObject) {
            CeylonFileObject fo = (CeylonFileObject) file;
            return super.inferBinaryName(location, fo.getFile());
        }
        return super.inferBinaryName(location, file);
    }
View Full Code Here

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

        nullCheck(kind);
        if (!sourceOrClass.contains(kind))
            throw new IllegalArgumentException("Invalid kind " + kind);
        JavaFileObject file = getFileForInput(location, forClass(className, kind));
        if (file != null && file.getName().endsWith(".ceylon")) {
            return new CeylonFileObject(file);
        } else {
            return file;
        }

    }
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.