Loading...
Searching...
No Matches
typeMaker.hpp
Go to the documentation of this file.
1
2#pragma once
3
5
6namespace by {
7
12 class _nout typeMaker {
13 BY(ME(typeMaker))
14
15 private:
16 static mgdType _make(void*, const std::string& typeName, const type& super, const params& ps, nbool isAdt,
17 const node* ret) {
18 return mgdType(typeName, super, ps, isAdt, ret);
19 }
20
21 static funcType _make(baseFunc*, const std::string& typeName, const type& super, const params& ps, nbool isAdt,
22 const node* ret) {
23 return funcType(typeName, super, ps, isAdt, ret);
24 }
25
26 public:
27 template <typename T> static auto make(const params& ps, const node* ret) {
28 return make<T>(ttype<T>::get().getName(), ps, ret);
29 }
30
31 template <typename T> static auto make(const std::string& typeName) {
32 return make<T>(typeName, params(), nullptr);
33 }
34
35 template <typename T> static auto make() { return make<T>(ttype<T>::get().getName()); }
36
37 template <typename T>
38 static auto make(const std::string& typeName, const params& ps, const node* ret)
39 -> decltype(_make((T*) nullptr, typeName, ttype<T>::get(), ps, !std::is_constructible<T>::value, ret)) {
40 return _make((T*) nullptr, typeName, ttype<T>::get(), ps, !std::is_constructible<T>::value, ret);
41 }
42 };
43}
Base class for all function types.
Definition baseFunc.hpp:41
script type for function objects in byeol language.
Definition funcType.hpp:11
Script type for byeol objects.
Definition mgdType.hpp:18
Base class for all AST nodes in the byeol language.
Definition node.hpp:195
Function parameter list container.
Definition params.hpp:16
Definition tnarr.hpp:9
Factory for creating script types.
Definition typeMaker.hpp:12
to Top