private static int getOperatorScore(QTree.Type type) { switch (type) { case QTree.Type.Add: case QTree.Type.Sub: return(1); case QTree.Type.Mul: return(2); case QTree.Type.Div: return(3); } return(1); }
public static string getOperatorStr(QTree.Type type) { switch (type) { case Type.Add: return("+"); case Type.Sub: return("-"); case Type.Mul: return("*"); case Type.Div: return("/"); } return(""); }
public static bool higherPriority(QTree.Type t1, QTree.Type t2) { return((t1 == Type.Div || t1 == Type.Mul) && (t2 == Type.Add || t2 == Type.Sub || t2 == Type.Null)); }