Beispiel #1
0
        /// <summary>
        /// Recorre todos los caracteres de la cadena y los procesa.
        /// </summary>
        /// <param name="value">Cadena de texto.</param>
        /// <returns>El <see cref="ExpressionTree"/> con los elementos de la cadena.</returns>
        private ExpressionTree ParseExpressionString(string value)
        {
            var tree = ExpressionTree.Create(value);
            var root = tree.Root;

            // Procesar cadena.
            ProcessSubstring(root, 0, null, delimiterOpened: false);

            // Finalizar.
            UploadEndIndexAllLevels(root);
            CollapseTree(ref root);
            tree.Root = root;
            return(tree);
        }
Beispiel #2
0
        /// <summary>
        /// Converts a <see cref="ExpressionNode"/> to <see cref="Expression"/>.
        /// </summary>
        /// <param name="expression">The <see cref="ExpressionTree"/> to be converted.</param>
        /// <returns>The <see cref="Expression"/> lambda expression.</returns>
        /// <exception cref="KeyNotFoundException">When the <see cref="ExpressionNodeType"/> is not implemented.</exception>
        public static Expression <Func <T, TResult> > Create(ExpressionTree expression)
        {
            var eb = new ExpressionBuilder <T, TResult>();

            return(eb.Lambda(eb.BuildExpression(expression)));
        }
Beispiel #3
0
 internal ExpressionNode(ExpressionTree tree) : this()
 {
     this.ExpressionTree = tree;
 }