public void CompareInternal(literal left, literal right) { if (left == null && right != null || left != null && right == null) throw_not_equal(left, right); if (left != null && right != null) { if (left.GetType() != right.GetType()) throw_not_equal(left, right); /*Type t = left.GetType(); MethodInfo mi = typeof(SyntaxTreeComparer).GetMethod("CompareInternal", new Type[] { t, t }); mi.Invoke(this, new object[] { left, right });*/ if (left is char_const) CompareInternal(left as char_const, right as char_const); else if (left is sharp_char_const) CompareInternal(left as sharp_char_const, right as sharp_char_const); else if (left is string_const) CompareInternal(left as string_const, right as string_const); else throw new NotImplementedException(left.GetType().ToString()); } }