Loading...
Searching...
No Matches
scalar.hpp
Go to the documentation of this file.
1
2#pragma once
3
5#include "core/ast/scope.hpp"
6
7namespace by {
8
14 class _nout scalar: public baseObj {
15 BY(ADT(scalar, baseObj))
16
17 public:
18 tstr<me> add(const me& rhs) const;
19 tstr<me> add(const me* it) const BY_SIDE_FUNC(add);
20
21 using super::sub;
22 tstr<me> sub(const me& rhs) const;
23 tstr<me> sub(const me* it) const BY_SIDE_FUNC(sub);
24
25 tstr<me> mul(const me& rhs) const;
26 tstr<me> mul(const me* it) const BY_SIDE_FUNC(mul);
27
28 tstr<me> div(const me& rhs) const;
29 tstr<me> div(const me* it) const BY_SIDE_FUNC(div);
30
31 tstr<me> mod(const me& rhs) const;
32 tstr<me> mod(const me* it) const BY_SIDE_FUNC(mod);
33
34 tstr<me> bitwiseAnd(const me& rhs) const;
35 tstr<me> bitwiseAnd(const me* it) const BY_SIDE_FUNC(bitwiseAnd);
36 tstr<me> bitwiseXor(const me& rhs) const;
37 tstr<me> bitwiseXor(const me* it) const BY_SIDE_FUNC(bitwiseXor);
38 tstr<me> bitwiseOr(const me& rhs) const;
39 tstr<me> bitwiseOr(const me* it) const BY_SIDE_FUNC(bitwiseOr);
40 tstr<me> lshift(const me& rhs) const;
41 tstr<me> lshift(const me* it) const BY_SIDE_FUNC(lshift);
42 tstr<me> rshift(const me& rhs) const;
43 tstr<me> rshift(const me* it) const BY_SIDE_FUNC(rshift);
44 virtual tstr<me> bitwiseNot() const = 0;
45
46 nbool eq(const me& rhs) const;
47 nbool eq(const me* it) const BY_SIDE_FUNC(eq);
48 nbool ne(const me& rhs) const;
49 nbool ne(const me* it) const BY_SIDE_FUNC(ne);
50 nbool gt(const me& rhs) const;
51 nbool gt(const me* it) const BY_SIDE_FUNC(gt);
52 nbool lt(const me& rhs) const;
53 nbool lt(const me* it) const BY_SIDE_FUNC(lt);
54 nbool ge(const me& rhs) const;
55 nbool ge(const me* it) const BY_SIDE_FUNC(ge);
56 nbool le(const me& rhs) const;
57 nbool le(const me* it) const BY_SIDE_FUNC(le);
58 nbool logicalAnd(const me& rhs) const;
59 nbool logicalAnd(const me* it) const BY_SIDE_FUNC(logicalAnd);
60 nbool logicalOr(const me& rhs) const;
61 nbool logicalOr(const me* it) const BY_SIDE_FUNC(logicalOr);
62
66 tstr<me> mov(const me& rhs);
67 tstr<me> mov(const me* it) BY_SIDE_FUNC(mov);
68
69 private:
70 virtual tstr<me> _add(const me& rhs, nbool reversed) const = 0;
71 virtual tstr<me> _sub(const me& rhs, nbool reversed) const = 0;
72 virtual tstr<me> _mul(const me& rhs, nbool reversed) const = 0;
73 virtual tstr<me> _div(const me& rhs, nbool reversed) const = 0;
74 virtual tstr<me> _mod(const me& rhs, nbool reversed) const = 0;
75 virtual tstr<me> _bitwiseAnd(const me& rhs, nbool reversed) const = 0;
76 virtual tstr<me> _bitwiseXor(const me& rhs, nbool reversed) const = 0;
77 virtual tstr<me> _bitwiseOr(const me& rhs, nbool reversed) const = 0;
78 virtual tstr<me> _lshift(const me& rhs, nbool reversed) const = 0;
79 virtual tstr<me> _rshift(const me& rhs, nbool reversed) const = 0;
80
81 virtual nbool _eq(const me& rhs) const = 0;
82 virtual nbool _ne(const me& rhs) const = 0;
83 virtual nbool _gt(const me& rhs) const = 0;
84 virtual nbool _lt(const me& rhs) const = 0;
85 virtual nbool _ge(const me& rhs) const = 0;
86 virtual nbool _le(const me& rhs) const = 0;
87 virtual nbool _logicalAnd(const me& rhs) const = 0;
88 virtual nbool _logicalOr(const me& rhs) const = 0;
89
90 virtual me& _mov(const me& rhs) = 0;
91 };
92} // namespace by
Base class for representing byeol objects.
Definition baseObj.hpp:73
Base class for arithmetic operations on primitive types.
Definition scalar.hpp:14
tstr< me > mov(const me &rhs)
Definition tnarr.hpp:9
to Top