-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCLikeCompiler.mpp
More file actions
37 lines (34 loc) · 821 Bytes
/
CLikeCompiler.mpp
File metadata and controls
37 lines (34 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
export module CppUtils.Language.CLikeCompiler;
import std;
import CppUtils.Type;
import CppUtils.String;
import CppUtils.Language.VirtualMachine;
export namespace CppUtils::Language::CLikeCompiler
{
/*
template<class CharT>
inline constexpr auto compile(const std::basic_string_view<CharT> source) -> std::basic_string<CharT>
{
using namespace std::literals;
constexpr auto cLikeCompiler = uR"(
main {
(: (1@ # call foobar
X
}
foobar {
N
}
)"sv;
auto compiler = CallStackCompiler::compile(cLikeCompiler);
auto output = std::unique_ptr<std::basic_string<CharT>>(VirtualMachine::execute<
std::basic_string<CharT>*,
std::size_t,
bool,
CharT,
const decltype(source)*>(
compiler,
&source));
return std::basic_string<CharT>{std::move(*output)};
}
*/
}