private void maybeCreateEquateOnScalar(Instruction instruction, int opIndex,
			Object operandRepresentation) {

		if (!(operandRepresentation instanceof Scalar)) {
			return;
		}

		Scalar scalar = (Scalar) operandRepresentation;

		int enoomLength = enoom.getLength();
		boolean anyValuesMatch = Arrays.stream(enoom.getValues()).anyMatch(enumValue -> {
			return scalar.equals(new Scalar(enoomLength * 8, enumValue, scalar.isSigned()));
		});

		if (!anyValuesMatch) {
			return;
		}

		if (program.getDataTypeManager().findDataTypeForID(enoom.getUniversalID()) == null) {
			enoom = (Enum) program.getDataTypeManager().addDataType(enoom, null);
		}

		Address addr = instruction.getAddress();
		removeUnusedEquates(opIndex, scalar, addr);

		long value = scalar.getValue();
		String equateName = EquateManager.formatNameForEquate(enoom.getUniversalID(), value);
		Equate equate = getOrCreateEquate(equateName, value);
		equate.addReference(addr, opIndex);
	}
Constructor

@param program The program to use
@param addresses The addresses to apply an enum to
@param enoom The enum to apply equates with
@param shouldDoOnSubOps true if the enum should also be applied to the sub-operands.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/equate/CreateEnumEquateCommand.java