asable.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "core/common.hpp"
5
6namespace by {
7
11 class _nout asable {
12 public:
13 virtual ~asable() = default;
14
15 public:
16 virtual nbool is(const type& from, const type& to) const = 0;
17 nbool is(const type& from, const type* to) BY_SIDE_FUNC(to, is(from, *to), false);
18 nbool is(const type* from, const type& to) BY_SIDE_FUNC(from, is(*from, to), false);
19 nbool is(const type* from, const type* to) BY_SIDE_FUNC(from&& to, is(*from, *to), false);
20
21 virtual str as(const node& from, const type& to) const = 0;
22 str as(const node& from, const type* to) const BY_SIDE_FUNC(to, as(from, *to), str());
23 str as(const node* from, const type& to) const BY_SIDE_FUNC(from, as(*from, to), str());
24 str as(const node* from, const type* to) const BY_SIDE_FUNC(from&& to, as(*from, *to), str());
25 };
26}
Type conversion interface.
Definition: asable.hpp:11
Base class for all AST nodes in byeol language.
Definition: node.hpp:30
Base class for runtime type information in byeol language.
Definition: type.hpp:12