public Set<AssemblyPatternBlock> scrapeInputContexts() {
		// We don't care about the actual default values, just if a context variable HAS a default
		// value. It's possible for a local context variable to be set in the default context, but
		// doing so is questionable. It could be an input context variable in that case, so to
		// account for it, we start with the default context mask. Doing so ensures those variables
		// are included
		AssemblyPatternBlock defaultCtx = new AssemblyDefaultContext(language).getDefault();

		// Erase the values for posterity; we don't care about them at this point
		Arrays.fill(defaultCtx.getVals(), (byte) 0);

		GlobalSetScraper globalSetScraper = new GlobalSetScraper(defaultCtx);
		SleighLanguages.traverseConstructors(language, globalSetScraper);

		AssemblyPatternBlock nonInputCtxMask = globalSetScraper.getContextMask().invertMask();

		ConstraintScraper constraintScraper =
			new ConstraintScraper(nonInputCtxMask, language.getContextBaseRegister().getNumBytes());
		SleighLanguages.traverseConstructors(language, constraintScraper);

		return constraintScraper.getInputContexts();
	}
{@return the set of all valid input contexts that affect constructor selection.}

<ol>
<li>Start with mask of the language's default context</li>
<li>Scrape language for <code>globalset</code> context variables and OR their masks into our
mask</li>
<li>Flip bits of our mask to get mask of context variables not used as input
(local/transient)</li>
<li>Check constructor constraints and use mask to get values of relevant input context
variables</li>
</ol>
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/languages/sleigh/InputContextScraper.java