blob: acbd6aa129d2399e5e2ba6fbc3e3d74e7aa52565 (
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
|
#ifndef EXPRESSION_H_
#define EXPRESSION_H_
#include <string>
#include <vector>
class Expression
{
public:
std::vector<Expression*> children;
class Value *const_value;
std::string var_name;
std::string call_funcname;
std::vector<std::string> call_argnames;
// Boolean: ! && ||
// Operators: * / % + -
// Relations: < <= == != >= >
// Vector element: []
// Condition operator: ?:
// Invert (prefix '-'): I
// Constant value: C
// Create Range: R
// Create Vector: V
// Create Matrix: M
// Lookup Variable: L
// Lookup member per name: N
// Function call: F
std::string type;
Expression();
~Expression();
Value evaluate(const class Context *context) const;
std::string toString() const;
};
std::ostream &operator<<(std::ostream &stream, const Expression &expr);
#endif
|