bzr branch
http://gegoxaren.bato24.eu/bzr/vqdr/trunk
|
1
by Gustav Hartvigsson
* Initial code - far from done |
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 |
}
|