internal virtual void AddArgument(ExpressionNode argument)
        {
#if DEBUG
            if (CompModSwitches.FunctionNode.TraceVerbose)
            {
                Debug.WriteLine("Add argument " + argument.ToString());
            }
#endif
            Debug.Assert(info >= 0, String.Format(Res.GetString(Res.Expr_UndefinedFunction), this.name));

            if (!funcs[info].IsVariantArgumentList && argumentCount >= funcs[info].argumentCount)
            {
                throw ExprException.FunctionArgumentCount(this.name);
            }

            if (arguments == null)
            {
                arguments = new ExpressionNode[initialCapacity];
            }
            else if (argumentCount == arguments.Length)
            {
                ExpressionNode[] bigger = new ExpressionNode[argumentCount * 2];
                System.Array.Copy(arguments, 0, bigger, 0, argumentCount);
                arguments = bigger;
            }
            arguments[argumentCount++] = argument;

#if DEBUG
            if (CompModSwitches.FunctionNode.TraceVerbose)
            {
                Debug.WriteLine("Append argument " + argument.ToString() + " to function " + funcs[info].name);
            }
#endif
        }
Example #2
0
        public override string ToString()
        {
            string str = "(" + Operators.ToString(op) + " " + right.ToString() + ")";

            return(str);
        }