38 :
IfNode{ nullptr, nullptr, nullptr }
51 , _cond{ std::move(
cond) }
52 , _then{ std::move(
then) }
53 , _else{ std::move(
else_) }
64 [[nodiscard]] TCALC_INLINE
auto&
cond() const noexcept {
return _cond; }
71 TCALC_INLINE
auto&
cond() noexcept {
return _cond; }
85 [[nodiscard]] TCALC_INLINE
auto&
then() const noexcept {
return _then; }
92 TCALC_INLINE
auto&
then() noexcept {
return _then; }
106 [[nodiscard]] TCALC_INLINE
auto&
else_() const noexcept {
return _else; }
113 TCALC_INLINE
auto&
else_() noexcept {
return _else; }
122 _else = std::move(
else_);
If node.
Definition control_flow.hpp:26
TCALC_INLINE auto & cond() const noexcept
Get the condition node.
Definition control_flow.hpp:64
TCALC_INLINE auto & then() const noexcept
Get the then node.
Definition control_flow.hpp:85
TCALC_INLINE void then(NodePtr<> then) noexcept
Set the then node.
Definition control_flow.hpp:99
TCALC_INLINE void cond(NodePtr<> cond) noexcept
Set the condition node.
Definition control_flow.hpp:78
TCALC_INLINE auto & cond() noexcept
Get the condition node.
Definition control_flow.hpp:71
TCALC_INLINE auto & then() noexcept
Get the then node.
Definition control_flow.hpp:92
TCALC_INLINE auto & else_() noexcept
Get the else node.
Definition control_flow.hpp:113
IfNode(NodePtr<> cond, NodePtr<> then, NodePtr<> else_)
Construct a new If Node object with nodes.
Definition control_flow.hpp:49
TCALC_INLINE auto & else_() const noexcept
Get the else node.
Definition control_flow.hpp:106
TCALC_INLINE void else_(NodePtr<> else_) noexcept
Set the else node.
Definition control_flow.hpp:120
IfNode()
Construct a new If Node object without nodes.
Definition control_flow.hpp:37
Base class for AST nodes.
Definition node.hpp:87
Base class for AST nodes.
std::shared_ptr< NT > NodePtr
Shared pointer to a node.
Definition node.hpp:119
NodeType
AST node type.
Definition node.hpp:30