PageRenderTime 147ms CodeModel.GetById 113ms app.highlight 1ms RepoModel.GetById 32ms app.codeStats 0ms

/source/core/frontend/Driver.ooc

http://github.com/nddrylliog/oc
Unknown | 35 lines | 26 code | 9 blank | 0 comment | 0 complexity | 5dde458357b815537732016a1bfca90a MD5 | raw file
 1
 2import frontend/[ParsingPool, BuildParams]
 3import io/File
 4import middle/Resolver
 5import ast/Module
 6import ../DynamicLoader
 7
 8Driver: class {
 9    
10    compile: static func (file: String, params: BuildParams) {
11
12        if(!File new(file) exists?()) {
13            "File not found: %s, bailing out" printfln(file)
14            exit(1)
15        }
16
17        // parse main module and dependencies!
18        pool := ParsingPool new(params)
19        mainJob := ParsingJob new(file, null)
20        pool push(mainJob)
21        pool exhaust()
22
23	if(params dump?) {
24	    pseudoBackend := DynamicLoader loadBackend("pseudo", params)
25	    pool done each(|j| 
26		pseudoBackend process(j module, params)
27	    )
28	}
29        
30        mainJob module main? = true
31        Resolver new(params, mainJob module) start()
32        
33    }
34 
35}