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

Binary operation base class. More...

#include <binaryop.hpp>

Inheritance diagram for tcalc::ast::BinaryOpNode:
tcalc::ast::Node

Public Member Functions

 BinaryOpNode (NodeType type)
 Construct a new Binary Op Node object with no subnodes.
 
 BinaryOpNode (NodeType type, NodePtr<> left, NodePtr<> right)
 Construct a new Binary Op Node object with subnodes.
 
TCALC_INLINE auto & left () const noexcept
 Get the left subnode.
 
TCALC_INLINE auto & left () noexcept
 Get the left subnode.
 
TCALC_INLINE void left (NodePtr<> left) noexcept
 Set the left subnode.
 
TCALC_INLINE auto & right () const noexcept
 Get the right subnode.
 
TCALC_INLINE auto & right () noexcept
 Get the right subnode.
 
TCALC_INLINE void right (NodePtr<> right) noexcept
 Set the right subnode.
 
- 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

Binary operation base class.

Constructor & Destructor Documentation

◆ BinaryOpNode() [1/2]

tcalc::ast::BinaryOpNode::BinaryOpNode ( NodeType  type)
inlineexplicit

Construct a new Binary Op Node object with no subnodes.

Parameters
typeNode type.

◆ BinaryOpNode() [2/2]

tcalc::ast::BinaryOpNode::BinaryOpNode ( NodeType  type,
NodePtr<>  left,
NodePtr<>  right 
)
inline

Construct a new Binary Op Node object with subnodes.

Parameters
typeNode type.
leftLeft subnode.
rightRight subnode.

Member Function Documentation

◆ left() [1/3]

TCALC_INLINE auto & tcalc::ast::BinaryOpNode::left ( ) const
inlinenoexcept

Get the left subnode.

Returns
const NodePtr<> Left subnode.

◆ left() [2/3]

TCALC_INLINE auto & tcalc::ast::BinaryOpNode::left ( )
inlinenoexcept

Get the left subnode.

Returns
NodePtr<> Left subnode.

◆ left() [3/3]

TCALC_INLINE void tcalc::ast::BinaryOpNode::left ( NodePtr<>  left)
inlinenoexcept

Set the left subnode.

Parameters
leftLeft subnode.

◆ right() [1/3]

TCALC_INLINE auto & tcalc::ast::BinaryOpNode::right ( ) const
inlinenoexcept

Get the right subnode.

Returns
const NodePtr<> Right subnode.

◆ right() [2/3]

TCALC_INLINE auto & tcalc::ast::BinaryOpNode::right ( )
inlinenoexcept

Get the right subnode.

Returns
NodePtr<> Right subnode.

◆ right() [3/3]

TCALC_INLINE void tcalc::ast::BinaryOpNode::right ( NodePtr<>  right)
inlinenoexcept

Set the right subnode.

Parameters
rightRight subnode.

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