示例#1
0
        public override string ToString(int orNestLevel = 0)
        {
            //被演算子の両方、又はどちらか片方がnullの場合
            if (_lOperand == null && _rOperand == null)
            {
                return("");
            }
            else if (_lOperand == null)
            {
                return(_rOperand.ToString(orNestLevel + 1));
            }
            else if (_rOperand == null)
            {
                return(_lOperand.ToString(orNestLevel + 1));
            }

            string retStr = "";

            if (orNestLevel == 0)
            {
                retStr = "(";
            }
            retStr += _lOperand.ToString(orNestLevel + 1) + " OR " +
                      _rOperand.ToString(orNestLevel + 1);
            if (orNestLevel == 0)
            {
                retStr += ")";
            }
            return(retStr);
        }
示例#2
0
        public override string ToString(int orNestLevel = 0)
        {
            //被演算子の両方、又はどちらか片方がnullの場合
            if (_lOperand == null && _rOperand == null)
            {
                return("");
            }
            else if (_lOperand == null)
            {
                return(_rOperand.ToString(0));
            }
            else if (_rOperand == null)
            {
                return(_lOperand.ToString(0));
            }

            string retStr = "";

            if (!(_lOperand is OrExp))
            {
                retStr = "(";
            }
            retStr += new AndExp(new OrExp(_lOperand, _rOperand),
                                 !new AndExp(_lOperand, _rOperand)).ToString();
            if (!(_rOperand is OrExp))
            {
                retStr += ")";
            }

            return(retStr);
        }
示例#3
0
 public override string ToString(int orNestLevel = 0)
 {
     if (_operand == null)
     {
         return("");
     }
     return("NOT (" + _operand.ToString(orNestLevel) + ")");
 }
示例#4
0
        public override string ToString(int orNestLevel = 0)
        {
            //被演算子の両方、又はどちらか片方がnullの場合
            if (_lOperand == null && _rOperand == null)
            {
                return("");
            }
            else if (_lOperand == null)
            {
                return(_rOperand.ToString(0));
            }
            else if (_rOperand == null)
            {
                return(_lOperand.ToString(0));
            }

            string retStr = "";

            retStr += _lOperand.ToString(0) + " AND " + _rOperand.ToString(0);
            return(retStr);
        }