private boolean shouldReplace(StringBuffer buf, String defName, int pos) {
		if (defName == null) {
			return false;
		}

		int currIndex = buf.indexOf(defName, pos);
		if (currIndex < 0) {
			return false; // nothing to replace
		}

		// this match is not exact so skip it (borrowing from JavaCharacter)
		if (currIndex > 0 && (Character.isJavaIdentifierStart(buf.charAt(currIndex - 1)) ||
			Character.isJavaIdentifierPart(buf.charAt(currIndex - 1)))) {
			return false;
		}
		int afterIndex = currIndex + defName.length();
		if (afterIndex < buf.length() && (Character.isJavaIdentifierStart(buf.charAt(afterIndex)) ||
			Character.isJavaIdentifierPart(buf.charAt(afterIndex)))) {
			return false;
		}

		//nextRepl = image.substring(0, currIndex);	// shift to location
		String replacementString = defs.get(defName).image;		// get replacement text
		if (replacementString.equals(defName)) {
			return false; // no need to replace
		}

		return true;
	}
return a string with all the macros substitute starting at pos in the input string.
@param image string to expand
@param pos position within string to start expanding
@return string with all substitutions applied
Ghidra/Features/Base/src/main/java/ghidra/app/util/cparser/CPP/DefineTable.java