Exemple #1
0
        private static BinaryOp TypeToOp(LT tp)
        {
            switch (tp)
            {
            case LT.OP_L:
                return(BinaryOp.L);

            case LT.OP_G:
                return(BinaryOp.G);

            case LT.OP_LE:
                return(BinaryOp.LE);

            case LT.OP_GE:
                return(BinaryOp.GE);

            case LT.OP_EQ:
                return(BinaryOp.EQ);

            case LT.OP_NE:
                return(BinaryOp.NE);

            case LT.OP_ADD:
                return(BinaryOp.ADD);

            case LT.OP_SUB:
                return(BinaryOp.SUB);

            case LT.OP_MUL:
                return(BinaryOp.MUL);

            case LT.OP_DIV:
                return(BinaryOp.DIV);

            case LT.OP_MOD:
                return(BinaryOp.MOD);

            case LT.OP_BAND:
                return(BinaryOp.B_AND);

            case LT.OP_BOR:
                return(BinaryOp.B_OR);

            case LT.OP_BSHL:
                return(BinaryOp.B_SHL);

            case LT.OP_BSHR:
                return(BinaryOp.B_SHR);

            case LT.OP_BXOR:
                return(BinaryOp.B_XOR);

            case LT.OP_BNOT:
                return(BinaryOp.B_NOT);

            default:
                throw new ArgumentOutOfRangeException(nameof(tp), tp, null);
            }
        }
Exemple #2
0
        private static AssignOp TypeToOp(LT tp)
        {
            switch (tp)
            {
            case LT.OP_ADD:
                return(AssignOp.ADD);

            case LT.OP_SUB:
                return(AssignOp.SUB);

            case LT.OP_MUL:
                return(AssignOp.MUL);

            case LT.OP_DIV:
                return(AssignOp.DIV);

            case LT.OP_MOD:
                return(AssignOp.MOD);

            default:
                throw new ArgumentOutOfRangeException(nameof(tp), tp, null);
            }
        }