예제 #1
0
        private ExpressionValue ParseTextConcatinationNode(TextConcatinationNode textConcatinationNode)
        {
            ExpressionValue leftExpressionValue  = ParseExpressionNode(textConcatinationNode.Left);
            ExpressionValue rightExpressionValue = ParseExpressionNode(textConcatinationNode.Right);

            return(leftExpressionValue.Combine(rightExpressionValue, ExpressionOperator.Plus));
        }
예제 #2
0
        private ExpressionValue ParseArthimeticNode(ArthimetricExpressionNode arthimeticExpressionNode)
        {
            ExpressionValue    leftExpressionValue  = ParseExpressionNode(arthimeticExpressionNode.Left);
            ExpressionValue    rightExpressionValue = ParseExpressionNode(arthimeticExpressionNode.Right);
            ExpressionOperator expressionOperator   = ExpressionOperator.Undefined;

            switch (arthimeticExpressionNode.Operator)
            {
            case ArthimetricOperator.Div:
                expressionOperator = ExpressionOperator.Divide;
                break;

            case ArthimetricOperator.Minus:
                expressionOperator = ExpressionOperator.Minus;
                break;

            case ArthimetricOperator.Plus:
                expressionOperator = ExpressionOperator.Plus;
                break;

            case ArthimetricOperator.Mult:
                expressionOperator = ExpressionOperator.Multiply;
                break;

            default:
                throw new NotImplementedException();
            }

            return(leftExpressionValue.Combine(rightExpressionValue, expressionOperator));
        }
예제 #3
0
        private ExpressionValue ParseLogicalNode(LogicalExpressionNode logicalExpressionNode)
        {
            ExpressionValue leftExpressionValue  = ParseExpressionNode(logicalExpressionNode.Left);
            ExpressionValue rightExpressionValue = ParseExpressionNode(logicalExpressionNode.Right);

            ExpressionOperator expressionOperator = ExpressionOperator.Undefined;

            switch (logicalExpressionNode.Operator)
            {
            case LogicalOperator.And:
                expressionOperator = ExpressionOperator.And;
                break;

            case LogicalOperator.Or:
                expressionOperator = ExpressionOperator.Or;
                break;

            default:
                throw new NotImplementedException();
            }

            return(leftExpressionValue.Combine(rightExpressionValue, expressionOperator));
        }