Search in sources :

Example 1 with DyvilCompiler

use of dyvilx.tools.compiler.DyvilCompiler in project Dyvil by Dyvil.

the class Package method loadClass.

public static IClass loadClass(String fileName, Name name, IClassConsumer consumer) {
    final DyvilCompiler compiler = rootPackage.compiler;
    for (Library library : compiler.config.libraries) {
        final InputStream inputStream = library.getInputStream(fileName);
        if (inputStream != null) {
            final ExternalClass externalClass = new ExternalClass(name);
            consumer.addClass(externalClass);
            return ClassReader.loadClass(compiler, externalClass, inputStream);
        }
    }
    return null;
}
Also used : InputStream(java.io.InputStream) DyvilCompiler(dyvilx.tools.compiler.DyvilCompiler) Library(dyvilx.tools.compiler.library.Library) ExternalClass(dyvilx.tools.compiler.ast.external.ExternalClass)

Aggregations

DyvilCompiler (dyvilx.tools.compiler.DyvilCompiler)1 ExternalClass (dyvilx.tools.compiler.ast.external.ExternalClass)1 Library (dyvilx.tools.compiler.library.Library)1 InputStream (java.io.InputStream)1