private DemangledDataType parseArrayPointerOrReference(String datatype, String name,
			ReplacedString replacedString, Matcher matcher) {

		// int (*)[8]
		// char (&)[7]
		// Foo<Bar> const* const (&) [3]

		String realName = replacedString.restoreReplacedText(name);

		DemangledDataType dt = new DemangledDataType(mangledSource, demangledSource, realName);
		String type = matcher.group(1);
		if (type.equals("*")) {
			dt.incrementPointerLevels();
		}
		else if (type.equals("&")) {
			dt.setLValueReference();
		}
		else {
			throw new DemanglerParseException("Unexpected charater inside of parens: " + type);
		}

		//
		// Grab the middle text, for example, inside:
		//
		// 		Foo<Bar> const* const (&) [3]
		//
		// we would like to grab 'const* const(&)' and similar text such as 'const* const*'
		//
		String safeDatatype = replacedString.getModifiedText();
		int midTextStart = safeDatatype.indexOf(name) + name.length();
		int midTextEnd = matcher.start(1) - 1; // -1 for opening '('
		String midText = safeDatatype.substring(midTextStart, midTextEnd);
		if (midText.contains(CONST)) {
			dt.setConst();
		}

		int pointers = StringUtils.countMatches(midText, '*');
		for (int i = 0; i < pointers; i++) {
			dt.incrementPointerLevels();
		}

		String arraySubscripts = matcher.group(2);
		int arrays = StringUtilities.countOccurrences(arraySubscripts, '[');
		dt.setArray(arrays);

		return dt;
	}
Walks backward from the given start position to find the next namespace separator.  This
allows clients to determine if a given position is inside of a namespace.

@param text the text to search
@param start the start position
@param stop the stop position
@return the start index of the namespace entry containing the current {@code start}
        index; -1 if no namespace start is found
Ghidra/Features/GnuDemangler/src/main/java/ghidra/app/util/demangler/gnu/GnuDemanglerParser.java