1
namespace VQDR.Expression {
3
class MultiplyOperatorToken : OperatorToken {
6
mandatory_num_child = 2;
7
priority = PRIO_MULTIPLICATIVE;
10
protected MultiplyOperatorToken (int position) {
14
public override void evaluate_self (Context instance) throws GLib.Error {
15
Token r_child = get_right_child (),
16
l_child = get_left_child ();
18
l_child.evaluate (instance);
19
r_child.evaluate (instance);
21
var sb = new GLib.StringBuilder ("(");
23
// We check the precidence of the token, and inclose the value if
24
// it has a lower precidence than multiply, if it is, we enclose it in a
26
if (l_child.priority > 0 && l_child.priority < priority) {
27
sb.append ("(").append (l_child.result_string).append (")");
28
//l_child.result_string = "(" + l_child.result_string + ")";
30
sb.append (l_child.result_string);
35
// We do the same with the othre child.
36
if (r_child.priority > 0 && r_child.priority < priority) {
37
sb.append ("(").append (r_child.result_string).append (")");
38
//r_child.result_string = "(" + r_child.result_string + ")";
40
sb.append (r_child.result_string);
45
result_value = l_child.result_value * l_child.result_value;
46
result_max_value = l_child.result_max_value * l_child.result_max_value;
47
result_min_value = l_child.result_min_value * l_child.result_min_value;
48
reorder_max_min_values ();
49
result_string = sb.str;