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

Variable assign node. More...

#include <variable.hpp>

Inheritance diagram for tcalc::ast::VarAssignNode:
tcalc::ast::Node

Public Member Functions

 VarAssignNode (std::string name)
 Construct a new Var Assign Node object.
 
 VarAssignNode (std::string name, NodePtr<> body)
 Construct a new Var Assign Node object with body.
 
TCALC_INLINE auto & name () const noexcept
 Get variable name.
 
TCALC_INLINE void name (std::string name) noexcept
 Set variable name.
 
TCALC_INLINE auto & body () const noexcept
 Get variable body.
 
TCALC_INLINE auto & body () noexcept
 Get variable body.
 
TCALC_INLINE void body (NodePtr<> body) noexcept
 Set variable body.
 
- 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

Variable assign node.

Constructor & Destructor Documentation

◆ VarAssignNode() [1/2]

tcalc::ast::VarAssignNode::VarAssignNode ( std::string  name)
inlineexplicit

Construct a new Var Assign Node object.

Parameters
nameVariable name.

◆ VarAssignNode() [2/2]

tcalc::ast::VarAssignNode::VarAssignNode ( std::string  name,
NodePtr<>  body 
)
inline

Construct a new Var Assign Node object with body.

Parameters
nameVariable name.
bodyVariable body.

Member Function Documentation

◆ body() [1/3]

TCALC_INLINE auto & tcalc::ast::VarAssignNode::body ( ) const
inlinenoexcept

Get variable body.

Returns
const NodePtr<>& Variable body.

◆ body() [2/3]

TCALC_INLINE auto & tcalc::ast::VarAssignNode::body ( )
inlinenoexcept

Get variable body.

Returns
NodePtr<>& Variable body.

◆ body() [3/3]

TCALC_INLINE void tcalc::ast::VarAssignNode::body ( NodePtr<>  body)
inlinenoexcept

Set variable body.

Parameters
bodyVariable body.

◆ name() [1/2]

TCALC_INLINE auto & tcalc::ast::VarAssignNode::name ( ) const
inlinenoexcept

Get variable name.

Returns
const std::string& Variable name.

◆ name() [2/2]

TCALC_INLINE void tcalc::ast::VarAssignNode::name ( std::string  name)
inlinenoexcept

Set variable name.

Parameters
nameVariable name.

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