protected ConvertConstantTask establishTask(DecompilerActionContext context,
			boolean setupFinal) {
		ClangToken tokenAtCursor = context.getTokenAtCursor();
		if (!(tokenAtCursor instanceof ClangVariableToken)) {
			return null;
		}
		Varnode convertVn = tokenAtCursor.getVarnode();
		if (convertVn == null || !convertVn.isConstant() || convertVn.getSize() > MAX_SCALAR_SIZE) {
			return null;
		}
		HighSymbol symbol = convertVn.getHigh().getSymbol();
		EquateSymbol convertSymbol = null;
		if (symbol != null) {
			if (symbol instanceof EquateSymbol) {
				convertSymbol = (EquateSymbol) symbol;
				int type = convertSymbol.getConvert();
				if (type == convertType || type == EquateSymbol.FORMAT_DEFAULT) {
					return null;
				}
			}
			else {
				return null;		// Something already attached to constant
			}
		}
		DataType convertDataType = convertVn.getHigh().getDataType();
		boolean convertIsSigned = false;
		if (convertDataType instanceof AbstractIntegerDataType) {
			if (convertDataType instanceof BooleanDataType) {
				return null;
			}
			convertIsSigned = ((AbstractIntegerDataType) convertDataType).isSigned();
		}
		else if (convertDataType instanceof Enum) {
			return null;
		}
		if (!setupFinal) {
			return new ConvertConstantTask(convertVn, convertIsSigned);
		}

		ConvertConstantTask task = null;

		String equateName = getEquateName(convertVn.getOffset(), convertVn.getSize(),
			convertIsSigned, context.getProgram());
		if (equateName == null) {		// A null is a user cancel
			return null;
		}
		Program program = context.getProgram();
		Address convertAddr;
		long convertHash;
		if (convertSymbol != null) {
			convertAddr = convertSymbol.getPCAddress();
			convertHash = 0;
			int convertIndex = -1;
			boolean foundEquate = false;
			EquateTable equateTable = program.getEquateTable();
			List<Equate> equates = equateTable.getEquates(convertAddr);
			for (Equate equate : equates) {
				if (equate.getValue() != convertVn.getOffset()) {
					continue;
				}
				for (EquateReference equateRef : equate.getReferences(convertAddr)) {
					convertHash = equateRef.getDynamicHashValue();
					convertIndex = equateRef.getOpIndex();
					foundEquate = true;
					break;
				}
				break;
			}
			if (!foundEquate) {
				Msg.error(this, "Symbol does not have matching entry in equate table");
				return null;
			}
			task = new ConvertConstantTask(context, equateName, convertAddr, convertVn,
				convertIsSigned, convertHash, convertIndex);
		}
		else {
			PcodeOp op = convertVn.getLoneDescend();
			convertAddr = op.getSeqnum().getTarget();

			DynamicHash dynamicHash = new DynamicHash(convertVn, 0);
			convertHash = dynamicHash.getHash();
			task = new ConvertConstantTask(context, equateName, convertAddr, convertVn,
				convertIsSigned, convertHash, -1);
			try {
				ScalarMatch scalarMatch = findScalarMatch(context.getProgram(), convertAddr,
					convertVn, TaskMonitor.DUMMY);
				if (scalarMatch != null) {
					long value = scalarMatch.scalar.getUnsignedValue();
					int size = scalarMatch.scalar.bitLength() / 8;
					if (size == 0) {
						size = 1;
					}
					value = ConvertConstantTask.signExtendValue(convertIsSigned, value, size);
					String altName =
						getEquateName(value, size, convertIsSigned, context.getProgram());
					if (altName == null) {
						altName = equateName;
					}
					// Don't create a named equate if the varnode and the instruction operand differ
					// as the name was selected specifically for the varnode
					if (convertType != EquateSymbol.FORMAT_DEFAULT || value == task.getValue()) {
						task.setAlternate(altName, scalarMatch.refAddr, scalarMatch.opIndex, value);
					}
				}
			}
			catch (CancelledException e) {
				// scalar match is not added to task
			}
		}
		return task;
	}
Given the context, set up the task object that will execute the conversion.
If setupFinal toggle is false, only enough of the task is set up to complete
the isEnabled test for the action.  Otherwise the whole task is set up, ready for runTask().
If the context is not suitable for a conversion, null is returned.
@param context is the given context for the action
@param setupFinal is true if a full task setup is needed
@return the task object or null
Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/ConvertConstantAction.java