45#include <agrum/base/core/math/cocoR/Parser.h>
46#include <agrum/base/core/math/cocoR/Scanner.h>
56 std::cout << std::endl;
57 std::list< FormulaPart > l;
59 l.push_front(s.top());
63 std::cout <<
"Stack: ";
64 for (
const auto& elt: l) {
65 std::cout << elt.str() <<
" ";
67 std::cout << std::endl;
72 std::cout <<
"Output: ";
73 for (
const auto& elt: v) {
74 std::cout << elt.str() <<
" ";
76 std::cout << std::endl;
142 if (
this == &source) {
return *
this; }
153 if (
this == &source) {
return *
this; }
155 type = std::move(source.type);
156 number = std::move(source.number);
158 function = std::move(source.function);
164 std::ostringstream s;
198 auto c_str = (
unsigned char*)
_formula_.c_str();
199 auto scanner =
new gum::formula::Scanner(c_str, (
int)
_formula_.size());
200 _scanner_ = std::unique_ptr< gum::formula::Scanner >(scanner);
203 _parser_ = std::unique_ptr< gum::formula::Parser >(parser);
287 if (
this == &source) {
return *
this; }
300 if (
this == &source) {
return *
this; }
304 _parser_ = std::move(source._parser_);
307 _output_ = std::move(source._output_);
308 _stack_ = std::move(source._stack_);
316 std::stack< FormulaPart > stack;
338 if (stack.size() != 1) {
344 return stack.top().number;
Exception : operation not allowed.
#define GUM_ERROR(type, msg)
gum is the global namespace for all aGrUM entities
void print_stack(std::stack< FormulaPart > s)
std::string func2str(FormulaPart::token_function func)
std::string to_string(const Formula &f)
void print_output(std::vector< FormulaPart > v)