Exemple #1
0
        public static SteExpression ResetAsArrayAccess(this SteExpression expr, string arrayName, IEnumerable <SteExpression> args)
        {
            var headSpecs = new SteArrayAccessHeadSpecs(arrayName);

            expr.Reset(headSpecs, args);

            return(expr);
        }
Exemple #2
0
        /// <summary>
        /// Create a function expression with some arguments
        /// </summary>
        /// <param name="arrayName"></param>
        /// <param name="args"></param>
        /// <returns></returns>
        public static SteExpression CreateArrayAccess(string arrayName, IEnumerable <SteExpression> args)
        {
            if (String.IsNullOrEmpty(arrayName))
            {
                throw new ArgumentNullException(nameof(arrayName), @"Array name not initialized");
            }

            var funcHeadSpecs = new SteArrayAccessHeadSpecs(arrayName);

            return(args == null
                ? new SteExpression(funcHeadSpecs, Enumerable.Empty <SteExpression>())
                : new SteExpression(funcHeadSpecs, args));
        }
Exemple #3
0
        public static SteExpression ResetAsArrayAccess(this SteExpression expr, string arrayName, bool clearArgs = true)
        {
            var headSpecs = new SteArrayAccessHeadSpecs(arrayName);

            if (clearArgs)
            {
                expr.Reset(headSpecs);
            }
            else
            {
                expr.ResetHead(headSpecs);
            }

            return(expr);
        }