Example #1
0
        public Object VisitBinaryLambdaFuncNode(IBinaryLambdaFuncASTNode binaryLambdaFunc)
        {
            if (binaryLambdaFunc == null)
            {
                throw new ArgumentNullException("binaryLambdaFunc", "The argument cannot equal to null");
            }

            ParameterExpression x = Expression.Parameter(typeof(int), "x");
            ParameterExpression y = Expression.Parameter(typeof(int), "y");

            Expression lambdaBody = null;

            lambdaBody = _createExpressionByOpType(binaryLambdaFunc.OpType, x, y);

            return(Expression.Lambda(lambdaBody, x, y).Compile());
        }
Example #2
0
 public string VisitBinaryLambdaFuncNode(IBinaryLambdaFuncASTNode binaryLambdaFunc)
 {
     return(string.Format("({0})", _constructOperationStr(binaryLambdaFunc.OpType)));
 }