static OptType<?> parse(Location loc, String typeName, Map<String, UserType<?>> userEnums)
				throws ParseException {
			OptType<?> type = BaseType.parseNoErr(typeName);
			if (type == null) {
				type = userEnums.get(typeName);
			}
			if (type == null) { // still
				throw new ParseException(loc, "%s: Invalid type %s".formatted(loc, typeName));
			}
			return type;
		}
A parser for reading attributes from a script header
Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/ScriptAttributesParser.java