private void buildMasks() {
		if (prototype == null || currentDepth != 0) {
			throw new IllegalStateException("Pattern is not complete");
		}
		if (instructionMask != null) {
			return;
		}

		instructionMask = mainGroup.getMask(prototype.getLength());

		for (int i = 0; i < getNumOperands(); i++) {

			byte[] opMask = buildOperandMask(i);
			operandMasks.add(opMask);

			// ensure that operand mask bits are not included in instruction mask
			clearBits(instructionMask, opMask);
		}

	}
Add instruction context pattern to the current pattern group.
@param maskvalue pattern mask/value
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/processors/sleigh/SleighDebugLogger.java