Line data Source code
1 : #ifndef COMPILER_H
2 : #define COMPILER_H
3 :
4 : #include "../lexicalAnalysis/nicoleSintax.h"
5 : #include "../options/optionsParser.h"
6 : #include "../parsingAnalysis/algorithm/topDown.h"
7 : #include "../visitors/codeGeneration/codeGeneration.h"
8 : #include "../visitors/fillSemanticInfo/fillSemanticInfo.h"
9 : #include "../visitors/monomorphize/monomorphize.h"
10 : #include "../visitors/printTree/printTree.h"
11 : #include "../visitors/typeAnalysis/typeAnalysis.h"
12 : #include "../visitors/validateTree/validateTree.h"
13 : #include <expected>
14 : #include <iostream>
15 : #include <memory>
16 : #include <variant>
17 :
18 : namespace nicole {
19 :
20 : class Compiler {
21 : protected:
22 : std::shared_ptr<Sintax> sintax_;
23 :
24 : public:
25 : explicit Compiler(const std::shared_ptr<Sintax> &sintax) noexcept
26 0 : : sintax_{sintax} {}
27 :
28 0 : virtual ~Compiler() = default;
29 :
30 0 : [[nodiscard]] const std::shared_ptr<Sintax> &sintax() const noexcept {
31 0 : return sintax_;
32 0 : }
33 :
34 : [[nodiscard]] virtual std::expected<std::monostate, Error>
35 : compile(const Options &options) const noexcept = 0;
36 : };
37 :
38 : } // namespace nicole
39 :
40 : #endif
|