private DemangledObject parseFunctionOrVariable(String demangled) {

		FunctionSignatureParts signatureParts = new FunctionSignatureParts(demangled);
		if (!signatureParts.isValidFunction()) {
			return parseVariable(demangled);
		}

		DemangledFunction function = new DemangledFunction(mangledSource, demangled, null);

		String simpleName = signatureParts.getName();

		if (simpleName.endsWith(LAMBDA_START)) {
			//
			// For lambdas, the signature parser will set the name to '{lambda', with the parameters
			// following that text in the original string.  We want the name to be the full lambda
			// text, without spaces.
			//
			String prefix = signatureParts.getRawParameterPrefix();
			int lambdaStart = prefix.length() - LAMBDA_START.length(); // strip off '{lambda'
			String lambdaText = demangled.substring(lambdaStart);
			LambdaName lambdaName = getLambdaName(lambdaText);
			String uniqueName = lambdaName.getFullText();
			String escapedLambda = removeBadSpaces(uniqueName);
			simpleName = simpleName.replace(LAMBDA_START, escapedLambda);
			function = new DemangledLambda(mangledSource, demangled, null);
			function.setBackupPlateComment(lambdaName.getFullText());
		}

		//
		// Function Parts: name, params, return type, modifiers
		//
		setNameAndNamespace(function, simpleName);

		for (DemangledParameter parameter : signatureParts.getParameters()) {
			function.addParameter(parameter);
		}

		String returnType = signatureParts.getReturnType();
		setReturnType(demangled, function, returnType);

		if (demangled.endsWith(CONST)) {
			function.setConst(true);
		}

		return function;
	}
Parses the given demangled string and creates a {@link DemangledObject}

@param mangled the original mangled text
@param demangled the demangled text
@param simplify true signals to simplify types where possible, such as using simple c++ 
typedefs where possible.
@return the demangled object
@throws DemanglerParseException if there is an unexpected error parsing
@see #parse(String, String, boolean)
Ghidra/Features/GnuDemangler/src/main/java/ghidra/app/util/demangler/gnu/GnuDemanglerParser.java