9 template <
typename T,
typename TACTIC>
class tnarr;
10 typedef tnarr<node, strTactic> narr;
35 typedef std::map<const ntype*, const ntype*> promoter;
36 typedef std::map<const ntype*, promoter> promoters;
54 virtual nbool isImpli(
const type&
to)
const;
61 template <
typename T> tstr<T> asImpli(
const node* it)
const BY_SIDE_FUNC(asImpli<T>);
63 virtual str asImpli(
const node& from,
const type& to)
const;
64 str asImpli(
const node& from,
const type* to)
const BY_SIDE_FUNC(to, asImpli(from, *to), str());
65 str asImpli(
const node* from,
const type& to)
const BY_SIDE_FUNC(from, asImpli(*from, to), str());
66 str asImpli(
const node* from,
const type* to)
const BY_SIDE_FUNC(from&& to, asImpli(*from, *to), str());
73 template <
typename T> nbool is()
const {
return this->is(
ttype<T>::get()); }
75 nbool is(
const type& to)
const;
78 template <
typename T> tstr<T> as(
const node& it)
const {
return this->as(it, ttype<T>::get()); }
80 template <
typename T> tstr<T> as(
const node* it)
const BY_SIDE_FUNC(as<T>);
82 str as(
const node& from,
const type& to)
const;
83 str as(
const node& from,
const type* to)
const BY_SIDE_FUNC(to, as(from, *to), str());
84 str as(
const node* from,
const type& to)
const BY_SIDE_FUNC(from, as(*from, to), str());
85 virtual str as(
const node* from,
const type* to)
const BY_SIDE_FUNC(from&& to, as(*from, *to), str());
111 template <
typename T>
const ntype* promote()
const {
return promote(
ttype<T>::get()); }
132 std::
string createNameWithParams()
const;
141 static promoters* _makeDeducers();
Collection of type converters.
Definition ases.hpp:13
Implicit type conversion collection.
Definition impliAses.hpp:12
Base class for all AST nodes in the byeol language.
Definition node.hpp:195
represents native c++ type system for byeol language
Definition ntype.hpp:33
nbool operator==(const type &rhs) const override
check whether two ntype are same in both of native and byeol runtime environments
nbool isSameSign(const type &rhs) const
const ntype * promote(const ntype &r) const
static const ntype * promote(const ntype &l, const ntype &r)
virtual nbool isImmutable() const
Checks if this type is immutable.
virtual nbool isCustom() const
Definition ntype.hpp:71
const params & getParams() const BY_CONST_FUNC(getParams()) virtual params &getParams()
Retrieves a non-const reference to the parameters associated with this type.
nbool isImpli() const
whether variable 'it' can be a subtype of T in runtime
Definition ntype.hpp:52
Function parameter list container.
Definition params.hpp:16
Template type wrapper providing entry point for meta information.
Definition ttype.hpp:37
Weak reference smart pointer with type-safe access.
Definition tweak.hpp:16
Core class for runtime type information in byeol language.
Definition type.hpp:100
Interface for objects that can provide their type information.
Definition typeProvidable.hpp:13
#define BY_SIDE_FUNC(...)
Side function macros for safe pointer operations.
Definition sideFunc.hpp:24