Function definition node.
More...
#include <function.hpp>
|
| FdefNode (std::string name) |
| Construct a new Fdef Node object only with name.
|
|
| FdefNode (std::string name, std::vector< std::string > args, NodePtr<> body) |
| Construct a new Fdef Node object with arguments and body.
|
|
TCALC_INLINE auto & | args () const noexcept |
| Get function arguments.
|
|
TCALC_INLINE auto & | args () noexcept |
| Get function arguments.
|
|
TCALC_INLINE void | push_arg (const std::string &arg) |
| Push a function argument.
|
|
TCALC_INLINE auto & | body () const noexcept |
| Get function body.
|
|
TCALC_INLINE auto & | body () noexcept |
| Get function body.
|
|
TCALC_INLINE void | body (NodePtr<> body) |
| Set function body.
|
|
TCALC_INLINE auto & | name () const noexcept |
| Get function name.
|
|
TCALC_INLINE void | name (std::string name) |
| Set function name.
|
|
| Node (NodeType type) |
| Construct a new Node object.
|
|
TCALC_INLINE auto | type () const noexcept |
| Get the node type.
|
|
Function definition node.
◆ FdefNode() [1/2]
tcalc::ast::FdefNode::FdefNode |
( |
std::string |
name | ) |
|
|
inlineexplicit |
Construct a new Fdef Node object only with name.
- Parameters
-
◆ FdefNode() [2/2]
tcalc::ast::FdefNode::FdefNode |
( |
std::string |
name, |
|
|
std::vector< std::string > |
args, |
|
|
NodePtr<> |
body |
|
) |
| |
|
inline |
Construct a new Fdef Node object with arguments and body.
- Parameters
-
name | Function name. |
args | Function arguments. |
body | Function body. |
◆ args() [1/2]
TCALC_INLINE auto & tcalc::ast::FdefNode::args |
( |
| ) |
const |
|
inlinenoexcept |
Get function arguments.
- Returns
- const std::vector<std::string>& Function arguments.
◆ args() [2/2]
TCALC_INLINE auto & tcalc::ast::FdefNode::args |
( |
| ) |
|
|
inlinenoexcept |
Get function arguments.
- Returns
- std::vector<std::string>& Function arguments.
◆ body() [1/3]
TCALC_INLINE auto & tcalc::ast::FdefNode::body |
( |
| ) |
const |
|
inlinenoexcept |
Get function body.
- Returns
- const NodePtr<>& Function body.
◆ body() [2/3]
TCALC_INLINE auto & tcalc::ast::FdefNode::body |
( |
| ) |
|
|
inlinenoexcept |
Get function body.
- Returns
- NodePtr<>& Function body.
◆ body() [3/3]
TCALC_INLINE void tcalc::ast::FdefNode::body |
( |
NodePtr<> |
body | ) |
|
|
inline |
Set function body.
- Parameters
-
◆ name() [1/2]
TCALC_INLINE auto & tcalc::ast::FdefNode::name |
( |
| ) |
const |
|
inlinenoexcept |
Get function name.
- Returns
- const std::string& Function name.
◆ name() [2/2]
TCALC_INLINE void tcalc::ast::FdefNode::name |
( |
std::string |
name | ) |
|
|
inline |
Set function name.
- Parameters
-
◆ push_arg()
TCALC_INLINE void tcalc::ast::FdefNode::push_arg |
( |
const std::string & |
arg | ) |
|
|
inline |
Push a function argument.
- Parameters
-
The documentation for this class was generated from the following file: