tcalc 0.2.0
 
Loading...
Searching...
No Matches
tcalc::ast::IfNode Class Reference

If node. More...

#include <control_flow.hpp>

Inheritance diagram for tcalc::ast::IfNode:
tcalc::ast::Node

Public Member Functions

 IfNode ()
 Construct a new If Node object without nodes.
 
 IfNode (NodePtr<> cond, NodePtr<> then, NodePtr<> else_)
 Construct a new If Node object with nodes.
 
TCALC_INLINE auto & cond () const noexcept
 Get the condition node.
 
TCALC_INLINE auto & cond () noexcept
 Get the condition node.
 
TCALC_INLINE void cond (NodePtr<> cond) noexcept
 Set the condition node.
 
TCALC_INLINE auto & then () const noexcept
 Get the then node.
 
TCALC_INLINE auto & then () noexcept
 Get the then node.
 
TCALC_INLINE void then (NodePtr<> then) noexcept
 Set the then node.
 
TCALC_INLINE auto & else_ () const noexcept
 Get the else node.
 
TCALC_INLINE auto & else_ () noexcept
 Get the else node.
 
TCALC_INLINE void else_ (NodePtr<> else_) noexcept
 Set the else node.
 
- Public Member Functions inherited from tcalc::ast::Node
 Node (NodeType type)
 Construct a new Node object.
 
TCALC_INLINE auto type () const noexcept
 Get the node type.
 

Detailed Description

If node.

Constructor & Destructor Documentation

◆ IfNode()

tcalc::ast::IfNode::IfNode ( NodePtr<>  cond,
NodePtr<>  then,
NodePtr<>  else_ 
)
inline

Construct a new If Node object with nodes.

Parameters
condCondition node.
thenThen node.
else_Else node.

Member Function Documentation

◆ cond() [1/3]

TCALC_INLINE auto & tcalc::ast::IfNode::cond ( ) const
inlinenoexcept

Get the condition node.

Returns
const NodePtr<>& Condition node.

◆ cond() [2/3]

TCALC_INLINE auto & tcalc::ast::IfNode::cond ( )
inlinenoexcept

Get the condition node.

Returns
NodePtr<>& Condition node.

◆ cond() [3/3]

TCALC_INLINE void tcalc::ast::IfNode::cond ( NodePtr<>  cond)
inlinenoexcept

Set the condition node.

Parameters
condCondition node.

◆ else_() [1/3]

TCALC_INLINE auto & tcalc::ast::IfNode::else_ ( ) const
inlinenoexcept

Get the else node.

Returns
const NodePtr<>& Else node.

◆ else_() [2/3]

TCALC_INLINE auto & tcalc::ast::IfNode::else_ ( )
inlinenoexcept

Get the else node.

Returns
NodePtr<>& Else node.

◆ else_() [3/3]

TCALC_INLINE void tcalc::ast::IfNode::else_ ( NodePtr<>  else_)
inlinenoexcept

Set the else node.

Parameters
else_Else node.

◆ then() [1/3]

TCALC_INLINE auto & tcalc::ast::IfNode::then ( ) const
inlinenoexcept

Get the then node.

Returns
const NodePtr<>& Then node.

◆ then() [2/3]

TCALC_INLINE auto & tcalc::ast::IfNode::then ( )
inlinenoexcept

Get the then node.

Returns
NodePtr<>& Then node.

◆ then() [3/3]

TCALC_INLINE void tcalc::ast::IfNode::then ( NodePtr<>  then)
inlinenoexcept

Set the then node.

Parameters
thenThen node.

The documentation for this class was generated from the following file: