Ultra 0.9.4
Loading...
Searching...
No Matches
nullary.h
Go to the documentation of this file.
1
12
13#if !defined(ULTRA_NULLARY_H)
14#define ULTRA_NULLARY_H
15
16#include "kernel/terminal.h"
17
18namespace ultra
19{
30class nullary : public terminal
31{
32public:
33 using terminal::terminal;
34
35 [[nodiscard]] virtual value_t eval() const = 0;
36 [[nodiscard]] value_t instance() const final { return this; }
37
38 [[nodiscard]] std::string to_string(format = c_format) const override
39 { return name() + "()"; }
40};
41
42} // namespace ultra
43
44#endif // include guard
Definition nullary.h:31
value_t instance() const final
Definition nullary.h:36
format
Supported rendering formats for symbol stringification.
Definition symbol.h:72
const std::string & name() const noexcept
Definition symbol.cc:51
Definition terminal.h:41
std::variant< D_VOID, D_INT, D_DOUBLE, D_STRING, const D_NULLARY *, D_ADDRESS, const D_VARIABLE *, D_IVECTOR > value_t
Definition value.h:54