def METHOD_NAME(self, constant=None, name=None, default_value=None, string=None):
    """
    Adds the definition of a constant to the constants that will be written on output
    Accepts one of:
        constant: A fully populated Constant instance
        name and default_value: Strings that define the name and the default value of the constant
        string: A String that is written out literally to the output (use this to intersperse comments between constants)
    :param constant:
    :param name:
    :param default_value:
    :param string:
    """
    if not constant and not all(name, default_value) and not string:
        raise ValueError("Either constant, name and default_value, or string must be specified")
    if constant is None:
        if string is not None:
            constant = Text(string)
        else:
            constant = Constant(name, default_value)
    self.constants.append(constant)