unlogic
Loading...
Searching...
No Matches
Compiler.h
Go to the documentation of this file.
1#ifndef UNLOGIC_COMPILER_H
2#define UNLOGIC_COMPILER_H
3
4#include <city/Assembly.h>
5#include <city/JIT.h>
6#include <expected>
7#include <variant>
8#include "Error.h"
9#include "Scope.h"
10#include "parser/Node.h"
11#include "parser/Parser.h"
12
13namespace unlogic
14{
15 using CompilationError = std::variant<Error, bf::Error>;
16
18 {
19 city::JIT jit_;
20 Scope scope_;
21 bf::SLRParser<ParserGrammarType> parser_;
22
23 public:
24 std::expected<city::Assembly, CompilationError> Compile(std::string_view program_text, std::vector<bf::Token<ParserGrammarType>> *tokens = nullptr);
25
26 Compiler();
27 };
28} // namespace unlogic
29
30#endif // UNLOGIC_COMPILER_H
std::expected< city::Assembly, CompilationError > Compile(std::string_view program_text, std::vector< bf::Token< ParserGrammarType > > *tokens=nullptr)
Definition Compiler.cpp:9
std::variant< Error, bf::Error > CompilationError
Definition Compiler.h:15