/vqdr/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/vqdr/trunk

« back to all changes in this revision

Viewing changes to src/libvqdr/token.vala

  • Committer: Gustav Hartvigsson
  • Date: 2022-06-01 12:30:01 UTC
  • mfrom: (52.1.3 int64)
  • Revision ID: gustav.hartvigsson@gmail.com-20220601123001-b5xs60wwym810hg1
Merged: lp:~gustav.hartvigsson/vqdr/int64

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
  
6
6
  public abstract class Token : GLib.Object {
7
7
    
8
 
    //public static int VALUES_OUTPUT_PRECISION_FACTOR = (int)Math.pow(10, VALUES_OUTPUT_PRECISION_DIGITS);
 
8
    //public static int32 VALUES_OUTPUT_PRECISION_FACTOR = (int)Math.pow(10, VALUES_OUTPUT_PRECISION_DIGITS);
9
9
    
10
10
    
11
11
    /** Max size of a single token */
12
 
    public const int MAX_TOKEN_STRING_LENGTH = 64;
 
12
    public const int32 MAX_TOKEN_STRING_LENGTH = 64;
13
13
    /** Max size of an expression */
14
 
    public const int MAX_TOTAL_STRING_LENGTH = 200;
 
14
    public const int32 MAX_TOTAL_STRING_LENGTH = 200;
15
15
 
16
16
    /** Max iteration number for a token (function) */
17
 
    public const int MAX_TOKEN_ITERATIONS = 500;
 
17
    public const int32 MAX_TOKEN_ITERATIONS = 500;
18
18
    /** Max iteration number for the expression */
19
 
    public const int MAX_TOTAL_ITERATIONS = 5000;
 
19
    public const int32 MAX_TOTAL_ITERATIONS = 5000;
20
20
    
21
21
    
22
22
    /**
125
125
    }
126
126
 
127
127
    /** Generation to use to get the root with @link parent */
128
 
    protected const int ROOT_GENERATION = int.MAX;
 
128
    protected const int32 ROOT_GENERATION = int.MAX;
129
129
    
130
130
    /* ********************************************************************** */
131
131
    
140
140
    public virtual Prio priority {public get; protected construct set;}
141
141
    
142
142
    /** Starting position of the token in the expression */
143
 
    public int position {get; protected set;}
 
143
    protected int32 position;
144
144
    
145
145
    private int internal_next_child_num;
146
146
    /** The index of the next child */
152
152
     * 
153
153
     * 
154
154
     */
155
 
    public int optional_num_child {public get; protected construct set;}
 
155
    public int32 optional_num_child {public get; protected construct set;}
156
156
    
157
157
    /** The mandatory number of child this token can have */
158
 
    public int mandatory_num_child {public get; protected construct set;}
 
158
    public int32 mandatory_num_child {public get; protected construct set;}
159
159
    
160
160
    /** 
161
161
     * The maximum number of chidren 
165
165
     * 
166
166
     * Can not be set.
167
167
     */
168
 
    public int max_num_child {get {
 
168
    public int32 max_num_child {get {
169
169
      return optional_num_child + mandatory_num_child;
170
170
     }}
171
171
     
191
191
    }
192
192
    
193
193
    
194
 
    protected Token (int position) {
 
194
    protected Token (int32 position) {
195
195
      this.position = position;
196
196
    }
197
197
    
216
216
     * 
217
217
     * and index of 0 is illegal.
218
218
     */
219
 
    public unowned Token? get_child (int index) requires (index > 0 && index <= max_num_child) {
 
219
    public unowned Token? get_child (int32 index) requires (index > 0 && index <= max_num_child) {
220
220
      
221
221
      return children[index -1 ];
222
222
    }
233
233
     * 
234
234
     * and index of 0 is illegal.
235
235
     */
236
 
    public void set_child (int index, Token? child) requires (index > 0 && index <= max_num_child) {
 
236
    public void set_child (int32 index, Token? child) requires (index > 0 && index <= max_num_child) {
237
237
      
238
238
      children[index - 1] = child;
239
239