def _string_token_value(tok):
    """
    Given an ESCAPED_STRING token, unquote and unescape its value, to
    obtain the actual string it represents.

    :param tok: an ESCAPED_STRING token
    :return: The string value
    """
    return tok.value[1:-1].replace('\\"', '"').replace("\\\\", "\\")