private <T> SleighPcodeUseropDefinition<T> compile(StructuredUserop annot, Lookup lookup,
			Method method) {
		if (annot == null) {
			throw new IllegalArgumentException("Method " + method + " is missing @" +
				StructuredUserop.class.getSimpleName() + " annotation.");
		}
		if (method.getReturnType() != void.class) {
			throw new IllegalArgumentException("Method " + method + " having @" +
				StructuredUserop.class.getSimpleName() + " annotation must return void.");
		}
		MethodHandle handle;
		try {
			handle = lookup.unreflect(method).bindTo(this);
		}
		catch (IllegalAccessException e) {
			throw new IllegalArgumentException("Cannot access " + method + " having @" +
				StructuredUserop.class.getSimpleName() + " annotation. Override getMethodLookup()");
		}
		Builder builder = factory.define(method.getName());

		DataType retType = type(annot.type());

		Parameter[] params = method.getParameters();
		@SuppressWarnings("unchecked")
		List<Entry<String, DataType>> paramsAndTypes = Arrays.asList(new Entry[params.length]);
		for (int i = 0; i < params.length; i++) {
			Parameter p = params[i];
			if (p.getType() != Var.class) {
				throw new IllegalArgumentException(
					"Parameter " + p + " of method " + method + " must have type Var.");
			}
			Param pAnnot = p.getAnnotation(Param.class);
			if (pAnnot == null) {
				throw new StructuredSleighError("No @" + Param.class.getSimpleName() +
					" annotation of parameter " + p + " of method " + method + ".");
			}
			String name = "".equals(pAnnot.name()) ? p.getName() : pAnnot.name();
			DataType type = type(pAnnot.type());
			paramsAndTypes.set(i, Map.entry(name, type));
		}
		builder.params(paramsAndTypes.stream().map(p -> p.getKey()).collect(Collectors.toList()));

		assert stack.isEmpty();
		root = new RoutineStmt(this, method.getName(), retType, () -> {
			List<Object> args = paramsAndTypes.stream()
					.map(p -> param(p.getKey(), p.getValue()))
					.collect(Collectors.toList());
			try {
				handle.invokeWithArguments(args);
			}
			catch (StructuredSleighError e) {
				throw e;
			}
			catch (Throwable e) {
				throw new StructuredSleighError(
					"Exception processing structured sleigh body",
					e);
			}
		});
		StringTree source = root.generate(FALL, FALL);
		builder.body(source.toString());
		return builder.build();
	}
Get the method lookup for this context

<p>
If the annotated methods cannot be accessed by {@link StructuredSleigh}, this method must be
overridden. It should simply return {@link MethodHandles#lookup()}. This is necessary when
the author chooses access modifiers other than {@code public}, which is good practice, or
when the class is an anonymous inner class, as is often the case with stand-alone use.

@return the lookup
Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/struct/StructuredSleigh.java