public void populateDefineEquates(DataTypeManager openDTMgrs[], DataTypeManager dtMgr) {
		int transactionID = dtMgr.startTransaction("Add Equates");

		Iterator<String> iter = getDefineNames();
		while (iter.hasNext()) {
			String defName = iter.next();

			String strValue = expandDefine(defName);
			if (strValue == null) {
				// couldn't expand, must have been a macro
				continue;
			}

			// strip off any casting/parentheses
			strValue = stripCast(strValue);

			long value = 0;
			Long lvalue = getCValue(strValue);

			if (lvalue == null) {
				try {
					lvalue = ExpressionEvaluator.evaluateToLong(strValue);
				}
				catch (Exception exc) {
					// ignore didn't parse well
				}
				if (lvalue == null) {
					continue;
				}
			}

			value = lvalue.longValue();

			populateDefineEquate(openDTMgrs, dtMgr, "defines", "define_", defName, value);
		}

		dtMgr.endTransaction(transactionID, true);
	}
Given a data type manager, populate defines with constant values as Enums
Ghidra/Features/Base/src/main/java/ghidra/app/util/cparser/CPP/DefineTable.java