aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/couscous/CouscousCompiler.java
blob: 9c909acb58054db44d4141ea8dde1f7abe56d186 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package org.zwobble.couscous;

import java.io.IOException;
import java.nio.file.Path;
import java.util.List;

import org.zwobble.couscous.ast.ClassNode;
import org.zwobble.couscous.frontends.java.JavaFrontend;

public class CouscousCompiler {
    private final JavaFrontend frontend;
    private final Backend backend;

    public CouscousCompiler(JavaFrontend frontend, Backend backend) {
        this.frontend = frontend;
        this.backend = backend;
    }

    public void compileDirectory(List<Path> sourcePaths, Path path) throws IOException {
        List<ClassNode> classes = frontend.readSourceDirectory(sourcePaths, path);
        backend.compile(classes);
    }

}