/vqdr/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/vqdr/trunk
1 by Gustav Hartvigsson
* Initial code - far from done
1
namespace VQDR.Expression {
2
  
3
  public class VariableValueToken : ValueToken {
4
    
5
    protected string name;
6
    
7
    construct {
14 by Gustav Hartvigsson
* Use enum instead of static values for the priority of operations.
8
      this.priority = Prio.VALUE;
1 by Gustav Hartvigsson
* Initial code - far from done
9
    }
10
    
52.1.3 by Gustav Hartvigsson
int -> int32
11
    public VariableValueToken (string name, int32 position) {
1 by Gustav Hartvigsson
* Initial code - far from done
12
      base (position);
13
      this.name = name;
14
    }
15
    
16
    
17
    public override void evaluate_self (Context instance) throws GLib.Error {
18
      // in the original code there was a check to see if the intance
19
      // was null, this is not needed here as we don't allow null for that
20
      // value.
21
      try {
31 by Gustav Hartvigsson
Changed over the Variabel class to use FastNumers
22
        result_value = instance.get_value (name);
1 by Gustav Hartvigsson
* Initial code - far from done
23
        result_string = "[" + name + ":" + result_value.to_string () + "]";
24
      } catch (GLib.Error? e) {
12.1.1 by Gustav Hartvigsson
* Switch to using FastNumber instead of something else.
25
        result_value.number = 0;
26
        result_min_value.number = 0;
27
        result_max_value.number = 0;
1 by Gustav Hartvigsson
* Initial code - far from done
28
        result_string = "";
29
        
30
        GLib.Error? err = null;
31
        GLib.Error.propagate (out err, e);
32
        throw e;
33
      }
34
    }
35
    
36
  }
37
  
38
}