コード例 #1
0
        public IType FindFunctionReturnType(String functionName, IASTNode first)
        {
            // locate the registered function by the given name
            ISQLFunction sqlFunction = RequireSQLFunction(functionName);

            // determine the type of the first argument...
            IType argumentType = null;

            if (first != null)
            {
                if (sqlFunction is CastFunction)
                {
                    argumentType = TypeFactory.HeuristicType(first.NextSibling.Text);
                }
                else if (first is SqlNode)
                {
                    argumentType = ((SqlNode)first).DataType;
                }
            }

            return(sqlFunction.ReturnType(argumentType, _sfi));
        }
コード例 #2
0
		/// <summary>
		/// Find the function return type given the function name and the first argument expression node.
		/// </summary>
		/// <param name="functionName">The function name.</param>
		/// <param name="first">The first argument expression.</param>
		/// <returns>the function return type given the function name and the first argument expression node.</returns>
		public IType FindFunctionReturnType(String functionName, IASTNode first)
		{
			// locate the registered function by the given name
			ISQLFunction sqlFunction = RequireSQLFunction(functionName);

			// determine the type of the first argument...
			IType argumentType = null;

			if (first != null)
			{
				if (functionName == "cast")
				{
					argumentType = TypeFactory.HeuristicType(first.NextSibling.Text);
				}
				else if (first is SqlNode)
				{
					argumentType = ((SqlNode) first).DataType;
				}
			}

			return sqlFunction.ReturnType(argumentType, _sfi);
		}