A Hugo incarnation of the blog.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

compiler.hpp 1017B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include "binop.hpp"
  3. #include "parse_driver.hpp"
  4. #include "definition.hpp"
  5. #include "type_env.hpp"
  6. #include "type.hpp"
  7. #include "global_scope.hpp"
  8. #include "mangler.hpp"
  9. #include "llvm_context.hpp"
  10. class compiler {
  11. private:
  12. file_mgr file_m;
  13. definition_group global_defs;
  14. parse_driver driver;
  15. type_env_ptr global_env;
  16. type_mgr type_m;
  17. mangler mng;
  18. global_scope global_scp;
  19. llvm_context ctx;
  20. void add_default_types();
  21. void add_binop_type(binop op, type_ptr type);
  22. void add_default_function_types();
  23. void parse();
  24. void typecheck();
  25. void translate();
  26. void compile();
  27. void create_llvm_binop(binop op);
  28. void generate_llvm();
  29. void output_llvm(const std::string& into);
  30. public:
  31. compiler(const std::string& filename);
  32. void operator()(const std::string& into);
  33. file_mgr& get_file_manager();
  34. type_mgr& get_type_manager();
  35. };