'Check if the next operation is a type-cast and return the cast if so.
Casting operators look like simple function calls on their parameters. This
code returns the cast operator found and the list of parameters provided by
the user to complete the cast operation.
In the case of a list, we allow the call to __GetValueList to also accept
custom GAE Types as values.
Args:
can_cast_list: Boolean to determine if list can be returned as one of the
cast operators. Default value is True.
Returns:
A tuple (cast operator, params) which represents the cast operation
requested and the parameters parsed from the cast clause.
None - if there is no TypeCast function or list is not allowed to be cast.'

def __TypeCast(self, can_cast_list=True):

    logging.log(LOG_LEVEL, 'Try    Type    Cast')
    cast_op = self.__AcceptRegex(self.__cast_regex)
    if (not cast_op):
        if (can_cast_list and self.__Accept('(')):
            cast_op = 'list'
        else:
            return None
    else:
        cast_op = cast_op.lower()
        self.__Expect('(')
    params = self.__GetValueList(values_intended_for_list=(cast_op == 'list'))
    self.__Expect(')')
    logging.log(LOG_LEVEL, 'Got    casting    operator    %s    with    params    %s', cast_op, repr(params))
    return (cast_op, params)
