Пример #1
0
            internal static UnaryOperatorKind DeriveUnaryOperatorKind(CSharp.UnaryOperatorKind operatorKind)
            {
                switch (operatorKind.Operator())
                {
                case CSharp.UnaryOperatorKind.UnaryPlus:
                    return(UnaryOperatorKind.Plus);

                case CSharp.UnaryOperatorKind.UnaryMinus:
                    return(UnaryOperatorKind.Minus);

                case CSharp.UnaryOperatorKind.LogicalNegation:
                    return(UnaryOperatorKind.Not);

                case CSharp.UnaryOperatorKind.BitwiseComplement:
                    return(UnaryOperatorKind.BitwiseNegation);

                case CSharp.UnaryOperatorKind.True:
                    return(UnaryOperatorKind.True);

                case CSharp.UnaryOperatorKind.False:
                    return(UnaryOperatorKind.False);
                }

                return(UnaryOperatorKind.None);
            }
Пример #2
0
            internal static bool IsDecrement(CSharp.UnaryOperatorKind operatorKind)
            {
                switch (operatorKind.Operator())
                {
                case CSharp.UnaryOperatorKind.PrefixDecrement:
                case CSharp.UnaryOperatorKind.PostfixDecrement:
                    return(true);

                default:
                    return(false);
                }
            }