Exemple #1
0
 public bool GetBool(Int64 Is, ExpressionMediator exm)
 {
     if (CaseType == CaseExpressionType.To)
     {
         return(LeftTerm.GetIntValue(exm) <= Is && Is <= RightTerm.GetIntValue(exm));
     }
     if (CaseType == CaseExpressionType.Is)
     {
         IOperandTerm term = OperatorMethodManager.ReduceBinaryTerm(Operator, new SingleTerm(Is), LeftTerm);
         return(term.GetIntValue(exm) != 0);
     }
     return(LeftTerm.GetIntValue(exm) == Is);
 }
Exemple #2
0
 public bool GetBool(string Is, ExpressionMediator exm)
 {
     if (CaseType == CaseExpressionType.To)
     {
         return(string.Compare(LeftTerm.GetStrValue(exm), Is, Config.SCExpression) <= 0 &&
                string.Compare(Is, RightTerm.GetStrValue(exm), Config.SCExpression) <= 0);
     }
     if (CaseType == CaseExpressionType.Is)
     {
         IOperandTerm term = OperatorMethodManager.ReduceBinaryTerm(Operator, new SingleTerm(Is), LeftTerm);
         return(term.GetIntValue(exm) != 0);
     }
     return(LeftTerm.GetStrValue(exm) == Is);
 }
            private void reduceLastThree()
            {
                //if (stack.Count < 2)
                //    throw new ExeEE("不正な時期の呼び出し");
                IOperandTerm right = (IOperandTerm)stack.Pop();//後から入れたほうが右側
                OperatorCode op    = (OperatorCode)stack.Pop();
                IOperandTerm left  = (IOperandTerm)stack.Pop();

                if (OperatorManager.IsTernary(op))
                {
                    if (stack.Count > 1)
                    {
                        reduceTernary(left, right, op);
                        return;
                    }
                    throw new CodeEE("式の数が不足しています");
                }

                IOperandTerm newTerm = OperatorMethodManager.ReduceBinaryTerm(op, left, right);

                stack.Push(newTerm);
            }