/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. import ParsingPool
  2. import ast/Module
  3. /**
  4. * Interface for pluggable frontends
  5. */
  6. Frontend: abstract class {
  7. module: Module
  8. pool: ParsingPool
  9. /**
  10. * Create a new frontend, able to parse .ooc files, attached to a given
  11. * ParsingPool. The pool is used to trigger the parsing of imported .ooc
  12. * files
  13. */
  14. init: func (=pool) {}
  15. /**
  16. * Given the path to an .ooc file, the frontend should parse it and produce
  17. * an AST for the module. It can trigger the parsing of imported .ooc files
  18. * using pool push()
  19. */
  20. parse: abstract func (path: String)
  21. }
  22. FrontendFactory: abstract class {
  23. init: func (pool: ParsingPool) {}
  24. create: abstract func -> Frontend
  25. }