31 std::vector<NodePtr<>> _args;
52 , _name{ std::move(name) }
53 , _args{ std::move(args) }
64 [[nodiscard]] TCALC_INLINE
auto&
args() const noexcept {
return _args; }
71 TCALC_INLINE
auto&
args() noexcept {
return _args; }
85 [[nodiscard]] TCALC_INLINE
auto&
name() const noexcept {
return _name; }
92 TCALC_INLINE
void name(std::string name) { _name = std::move(name); }
103 std::vector<std::string> _args;
113 :
FdefNode{ std::move(name), {}, {} }
126 , _name{ std::move(name) }
127 , _args{ std::move(args) }
128 , _body{ std::move(body) }
139 [[nodiscard]] TCALC_INLINE
auto&
args() const noexcept {
return _args; }
146 TCALC_INLINE
auto&
args() noexcept {
return _args; }
153 TCALC_INLINE
void push_arg(
const std::string& arg) { _args.push_back(arg); }
160 [[nodiscard]] TCALC_INLINE
auto&
body() const noexcept {
return _body; }
167 TCALC_INLINE
auto&
body() noexcept {
return _body; }
181 [[nodiscard]] TCALC_INLINE
auto&
name() const noexcept {
return _name; }
188 TCALC_INLINE
void name(std::string name) { _name = std::move(name); }
Function node.
Definition function.hpp:28
FcallNode(std::string name)
Construct a new Function Node object.
Definition function.hpp:39
TCALC_INLINE auto & args() const noexcept
Get function arguments.
Definition function.hpp:64
TCALC_INLINE void name(std::string name)
Set function name.
Definition function.hpp:92
TCALC_INLINE auto & args() noexcept
Get function arguments.
Definition function.hpp:71
FcallNode(std::string name, std::vector< NodePtr<> > args)
Construct a new Function Node object.
Definition function.hpp:50
TCALC_INLINE void push_arg(const NodePtr<> &arg)
Push a function argument.
Definition function.hpp:78
TCALC_INLINE auto & name() const noexcept
Get function name.
Definition function.hpp:85
Function definition node.
Definition function.hpp:100
TCALC_INLINE auto & body() const noexcept
Get function body.
Definition function.hpp:160
TCALC_INLINE auto & name() const noexcept
Get function name.
Definition function.hpp:181
TCALC_INLINE auto & args() noexcept
Get function arguments.
Definition function.hpp:146
TCALC_INLINE void name(std::string name)
Set function name.
Definition function.hpp:188
TCALC_INLINE void body(NodePtr<> body)
Set function body.
Definition function.hpp:174
TCALC_INLINE auto & args() const noexcept
Get function arguments.
Definition function.hpp:139
TCALC_INLINE auto & body() noexcept
Get function body.
Definition function.hpp:167
FdefNode(std::string name)
Construct a new Fdef Node object only with name.
Definition function.hpp:112
FdefNode(std::string name, std::vector< std::string > args, NodePtr<> body)
Construct a new Fdef Node object with arguments and body.
Definition function.hpp:124
TCALC_INLINE void push_arg(const std::string &arg)
Push a function argument.
Definition function.hpp:153
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