blob: 02c7ff665fe0667980299c49669a9fa4375ab19a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#ifndef EVALUATOR_H_
#define EVALUATOR_H_
#include <string>
#include "value.h"
class evaluator {
public:
evaluator(const char * display_name);
virtual value * evaluate(
value * l,
value * r);
virtual value * evaluate(
float_value * l,
value * r);
virtual value * evaluate(
value * r,
float_value * l);
virtual value * evaluate(
float_value * l,
float_value * r) = 0;
virtual std::string to_string();
protected:
value * default_evaluate(
value * l,
value * r);
private:
value_type get_value_type(value * val);
const char * m_display_name;
};
class add_evaluator : public evaluator{
public:
add_evaluator();
value * evaluate(
float_value * l,
float_value * r);
};
class mul_evaluator : public evaluator {
public:
mul_evaluator();
value * evaluate(
float_value * l,
float_value * r);
};
class abs_evaluator : public evaluator {
public:
abs_evaluator();
value * evaluate(
float_value * l,
float_value * r);
};
#endif //EVALUATOR_H_
|