public final Equate createEquate(Data data, String equateName) throws Exception {
		Object value = data.getValue();
		if (value instanceof Scalar) {
			Scalar scalar = (Scalar) value;
			long scalarValue = scalar.getUnsignedValue();
			Equate equate = currentProgram.getEquateTable().createEquate(equateName, scalarValue);
			equate.addReference(data.getMinAddress(), 0);
			return equate;
		}
		throw new InvalidInputException(
			"Unable to create equate on non-scalar value at " + data.getMinAddress());
	}
Creates a new equate on the scalar value
at the value of the data.
@param data the data
@param equateName the name of the equate
@return the newly created equate
@throws InvalidInputException if a scalar does not exist on the data
@throws Exception if there is any exception
Ghidra/Features/Base/src/main/java/ghidra/program/flatapi/FlatProgramAPI.java