/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/operator/operator_token.vala

  • Committer: Gustav Hartvigsson
  • Date: 2020-06-07 18:48:24 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20200607184824-jf14f7a1b1di2i2q
* Initial code - far from done

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using VQDR.Common;
 
2
 
 
3
namespace VQDR.Expression {
 
4
  public abstract class OperatorToken : Token {
 
5
    
 
6
    protected OperatorToken (int position) {
 
7
      base (position);
 
8
    }
 
9
    
 
10
    public static OperatorToken? init_token (string name,
 
11
                                             int position)
 
12
                                             throws ParseError {
 
13
      switch (name) {
 
14
        case "+": 
 
15
          //return new AddOperatiorToken (position);
 
16
        break;
 
17
        case "-":
 
18
          //return new SubtractOperatiorTokes (position);
 
19
        break;
 
20
        case "*":
 
21
          //return new MultiplyOperatiorToken (position);
 
22
        break;
 
23
        case "/":
 
24
          //return new DevideOperatiorToken (position);
 
25
        break;
 
26
        case "d":
 
27
        case "w":
 
28
        case "t":
 
29
          //return new DiceOperatiorToken (position);
 
30
        break;
 
31
      }
 
32
      throw new ParseError.INVALID_CHARECTER (@"Could not decode $name," +
 
33
                                              " it is not a valid operation.");
 
34
    }
 
35
    
 
36
  }
 
37
}