1
0
mirror of https://github.com/chylex/Query.git synced 2025-08-16 23:31:42 +02:00
Files
Query/AppCalc/Operators.cs
2024-07-29 16:57:33 +02:00

29 lines
679 B
C#

namespace AppCalc{
internal static class Operators{
internal static readonly string[] With2Operands = { "+", "-", "*", "/", "%", "^" };
internal static int GetPrecedence(string token){
switch(token){
case "^":
return 4;
case "*":
case "/":
case "%":
return 3;
case "+":
case "-":
return 2;
default:
return 1;
}
}
internal static bool IsRightAssociative(string token){
return token == "^";
}
}
}