Esempio n. 1
0
        public override Expression AsExpression(Registers registers)
        {
            var transpose = false;

            var leftExpr  = registers.GetKExpression(m_left, Line);
            var rightExpr = registers.GetKExpression(m_right, Line);

            if (((m_left | m_right) & 256) == 0)
            {
                transpose = registers.GetUpdated(m_left, Line) > registers.GetUpdated(m_right, Line);
            }
            else
            {
                transpose = rightExpr.ConstantIndex < leftExpr.ConstantIndex;
            }

            var op = !transpose ? "<" : ">";

            Expression rtn = new BinaryExpression(op, !transpose ? leftExpr : rightExpr, !transpose ? rightExpr : leftExpr, Expression.PRECEDENCE_COMPARE, Expression.ASSOCIATIVITY_LEFT);

            if (m_invert)
            {
                rtn = Expression.MakeNOT(rtn);
            }

            return(rtn);
        }
Esempio n. 2
0
        public override Expression AsExpression(Registers registers)
        {
            var transpose = false;
            var op        = (m_invert) ? "~=" : "==";

            return(new BinaryExpression(op,
                                        registers.GetKExpression(!transpose ? m_left : m_right, Line),
                                        registers.GetKExpression(!transpose ? m_right : m_left, Line),
                                        Expression.PRECEDENCE_COMPARE,
                                        Expression.ASSOCIATIVITY_LEFT));
        }