Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Operators.cs
Go to the documentation of this file.
1namespace System.Data;
2
3internal sealed class Operators
4{
5 private static readonly int[] s_priority = new int[44]
6 {
7 0, 20, 20, 9, 12, 11, 11, 13, 13, 13,
8 13, 13, 13, 10, 11, 16, 16, 19, 19, 18,
9 17, 21, 8, 7, 6, 9, 8, 7, 2, 22,
10 23, 23, 24, 24, 24, 24, 24, 24, 24, 24,
11 24, 24, 24, 24
12 };
13
14 private static readonly string[] s_looks = new string[40]
15 {
16 "", "-", "+", "Not", "BetweenAnd", "In", "Between", "=", ">", "<",
17 ">=", "<=", "<>", "Is", "Like", "+", "-", "*", "/", "\\",
18 "Mod", "**", "&", "|", "^", "~", "And", "Or", "Proc", "Iff",
19 ".", ".", "Null", "True", "False", "Date", "GenUniqueId()", "GenGuid()", "Guid {..}", "Is Not"
20 };
21
22 internal static bool IsArithmetical(int op)
23 {
24 if (op != 15 && op != 16 && op != 17 && op != 18)
25 {
26 return op == 20;
27 }
28 return true;
29 }
30
31 internal static bool IsLogical(int op)
32 {
33 if (op != 26 && op != 27 && op != 3 && op != 13)
34 {
35 return op == 39;
36 }
37 return true;
38 }
39
40 internal static bool IsRelational(int op)
41 {
42 if (7 <= op)
43 {
44 return op <= 12;
45 }
46 return false;
47 }
48
49 internal static int Priority(int op)
50 {
51 if (op > s_priority.Length)
52 {
53 return 24;
54 }
55 return s_priority[op];
56 }
57
58 internal static string ToString(int op)
59 {
60 if (op <= s_looks.Length)
61 {
62 return s_looks[op];
63 }
64 return "Unknown op";
65 }
66}
static readonly int[] s_priority
Definition Operators.cs:5
static readonly string[] s_looks
Definition Operators.cs:14
static bool IsArithmetical(int op)
Definition Operators.cs:22
static int Priority(int op)
Definition Operators.cs:49
static bool IsRelational(int op)
Definition Operators.cs:40
static string ToString(int op)
Definition Operators.cs:58
static bool IsLogical(int op)
Definition Operators.cs:31