PageRenderTime 18ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/source/core/frontend/Frontend.ooc

http://github.com/nddrylliog/oc
Unknown | 35 lines | 25 code | 10 blank | 0 comment | 0 complexity | 41301713dae74abff777a7893a780b09 MD5 | raw file
 1
 2import ParsingPool
 3import ast/Module
 4
 5/**
 6 * Interface for pluggable frontends
 7 */
 8Frontend: abstract class {
 9    
10    module: Module
11    pool: ParsingPool
12    
13    /**
14     * Create a new frontend, able to parse .ooc files, attached to a given
15     * ParsingPool. The pool is used to trigger the parsing of imported .ooc
16     * files
17     */
18    init: func (=pool) {}
19    
20    /**
21     * Given the path to an .ooc file, the frontend should parse it and produce
22     * an AST for the module. It can trigger the parsing of imported .ooc files
23     * using pool push()
24     */
25    parse: abstract func (path: String)
26    
27}
28
29FrontendFactory: abstract class {
30    
31    init: func (pool: ParsingPool) {}
32    
33    create: abstract func -> Frontend
34    
35}