def def_default_float_token(parser, token_label='k_float', signed=True,
    require_decimal=False, on_ties=0):
    """Define a token for floats with default label 'k_float'.  If `signed` is true (the
    default) then a leading '+' or '-' is optionally part of the float.  Otherwise
    the sign is not included.  This is sometimes needed when the signs are defined
    as a prefix operators instead."""
    if require_decimal:
        regex = '(\\d+\\.\\d*)([eE][-+]?\\d+)?'
    else:
        regex = '(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?'
    if signed:
        regex = '[+-]?' + regex
    tok = parser.def_token(token_label, regex, on_ties=on_ties)
    return tok
