25 void print(std::ostream& stream,
int indent)
const;
33 void save(std::ostream& stream)
const;
36 static std::shared_ptr<node_impl>
read_node(std::istream& stream);
41 virtual void print_node(std::ostream& stream,
int indent)
const = 0;
45 virtual void save_node(std::ostream& stream)
const = 0;
56 virtual void print_node(std::ostream& stream,
int indent)
const override;
59 virtual void save_node(std::ostream& stream)
const override;
71 virtual void print_node(std::ostream& stream,
int indent)
const override;
73 virtual void save_node(std::ostream& stream)
const override;
85 std::string
const&
name()
const;
87 virtual void print_node(std::ostream& stream,
int indent)
const override;
90 virtual void save_node(std::ostream& stream)
const override;
105 virtual void print_node(std::ostream& stream,
int indent)
const override;
108 virtual void save_node(std::ostream& stream)
const override;
119 std::string
name()
const;
122 virtual void print_node(std::ostream& stream,
int indent)
const override;
124 virtual void save_node(std::ostream& stream)
const override;
139 virtual void print_node(std::ostream& stream,
int indent)
const override = 0;
141 virtual void save_node(std::ostream& stream)
const override = 0;
157 virtual void print_node(std::ostream& stream,
int indent)
const override = 0;
159 virtual void save_node(std::ostream& stream)
const override = 0;
171 virtual void print_node(std::ostream& stream,
int indent)
const override;
173 virtual void save_node(std::ostream& stream)
const override;
182 virtual void print_node(std::ostream& stream,
int indent)
const override;
184 virtual void save_node(std::ostream& stream)
const override;
193 virtual void print_node(std::ostream& stream,
int indent)
const override;
195 virtual void save_node(std::ostream& stream)
const override;
204 virtual void print_node(std::ostream& stream,
int indent)
const override;
206 virtual void save_node(std::ostream& stream)
const override;
215 virtual void print_node(std::ostream& stream,
int indent)
const override;
217 virtual void save_node(std::ostream& stream)
const override;
virtual double evaluate_node() const override
node_number(double value)
virtual void save_node(std::ostream &stream) const override=0
virtual void save_node(std::ostream &stream) const override=0
double evaluate_right() const
virtual void save_node(std::ostream &stream) const override
void save(std::ostream &stream) const
virtual void save_node(std::ostream &stream) const override
virtual std::string evaluate_string() const override
virtual std::string evaluate_string() const
virtual void print_node(std::ostream &stream, int indent) const override
virtual double evaluate_node() const =0
virtual double evaluate_node() const override
node_list const & arguments() const
virtual void print_node(std::ostream &stream, int indent) const override
virtual void print_node(std::ostream &stream, int indent) const override
double evaluate_left() const
virtual void save_node(std::ostream &stream) const override
node_function_call(std::string name, node_list arguments)
node_binary(node left, node right)
virtual double evaluate_node() const override=0
virtual double evaluate_node() const override
virtual double evaluate_node() const override
std::string const & name() const
virtual void print_node(std::ostream &stream, int indent) const override
virtual std::string evaluate_string() const override
node_identifier(std::string name)
virtual void save_node(std::ostream &stream) const override
virtual void print_node(std::ostream &stream, int indent) const override
virtual double evaluate_node() const override
virtual double evaluate_node() const override
void print(std::ostream &stream, int indent) const
std::vector< std::string > identifier_list
A sequence of identifiers (e.g., parameter names).
static std::shared_ptr< node_impl > read_node(std::istream &stream)
virtual double evaluate_node() const override=0
virtual void print_node(std::ostream &stream, int indent) const override
virtual void save_node(std::ostream &stream) const override
node_function(identifier_list parameters, node definition)
double evaluate_operand() const
node_impl & operator=(node_impl const &n)
not implemented
node_multiply(node left, node right)
virtual identifier_list const & evaluate_parameters() const override
virtual void print_node(std::ostream &stream, int indent) const override
virtual void save_node(std::ostream &stream) const override
virtual void print_node(std::ostream &stream, int indent) const override
virtual void print_node(std::ostream &stream, int indent) const =0
identifier_list parameters_
node_subtract(node left, node right)
virtual void save_node(std::ostream &stream) const =0
virtual double evaluate_node() const override
virtual void print_node(std::ostream &stream, int indent) const override
virtual identifier_list const & evaluate_parameters() const
virtual void save_node(std::ostream &stream) const override
virtual double evaluate_node() const override
identifier_list const & get_parameters() const
std::vector< node > node_list
A sequence of nodes.
std::string to_string() const
virtual void save_node(std::ostream &stream) const override
node_negate(node operand)
virtual void print_node(std::ostream &stream, int indent) const override
virtual double evaluate_node() const override
virtual void save_node(std::ostream &stream) const override
node_divide(node left, node right)
virtual void print_node(std::ostream &stream, int indent) const override=0
node_add(node left, node right)
virtual void save_node(std::ostream &stream) const override
identifier_list const & parameters() const
virtual void print_node(std::ostream &stream, int indent) const override=0
virtual double evaluate_node() const override