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
13
namespace
unlogic
14
{
15
using
CompilationError
= std::variant<Error, bf::Error>;
16
17
class
Compiler
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
Error.h
Node.h
Parser.h
Scope.h
unlogic::Compiler
Definition
Compiler.h:18
unlogic::Compiler::Compile
std::expected< city::Assembly, CompilationError > Compile(std::string_view program_text, std::vector< bf::Token< ParserGrammarType > > *tokens=nullptr)
Definition
Compiler.cpp:9
unlogic::Compiler::Compiler
Compiler()
Definition
Compiler.cpp:53
unlogic::Scope
Definition
Scope.h:13
unlogic
Definition
Compiler.h:14
unlogic::CompilationError
std::variant< Error, bf::Error > CompilationError
Definition
Compiler.h:15
unlogic
src
compiler
Compiler.h
Generated by
1.9.8