private boolean parseCall(Expression expr) throws InvalidSpecCompileException {
    call = expr;

    if (AstUtil.isWildcardRef(expr)) {
      wildcardCall = true;
      implicitTarget = activeWithOrMockClosure != null;
      return true;
    }

    if (expr instanceof PropertyExpression
        || expr instanceof MethodCallExpression
        || expr instanceof ConstructorCallExpression) {
      if (AstUtil.isInvocationWithImplicitThis(expr)) {
        if (activeWithOrMockClosure == null || !AstUtil.hasImplicitParameter(activeWithOrMockClosure)) {
          throw new InvalidSpecCompileException(call, "Interaction is missing a target");
        }
        implicitTarget = true;
      }

      return true;
    }

    if (expr instanceof VariableExpression
      && ((VariableExpression) expr).getAccessedVariable() instanceof DynamicVariable) {

      if (activeWithOrMockClosure == null || !AstUtil.hasImplicitParameter(activeWithOrMockClosure)) {
        throw new InvalidSpecCompileException(call, "Interaction is missing a target");
      }
      call = new PropertyExpression(new VariableExpression(new DynamicVariable("it", false)), ((VariableExpression) expr).getName());
      call.setSourcePosition(expr);
      implicitTarget = true;

      return true;
    }

    // StaticMethodCallExpression is only used for unqualified calls to static methods
    if (expr instanceof StaticMethodCallExpression) return false;

    return false;
  }
If the given statement is a valid interaction definition, returns the rewritten statement.
If the given statement is not an interaction definition, returns null.
If the given statement is an invalid interaction definition, records a compile error
and returns null.
spock-core/src/main/java/org/spockframework/compiler/InteractionRewriter.java