An instance variable result can be used to transfer the result of a method invocation. Instance variable depth will be used to record the current depth in the method invocation tree.
For each formal argument fi of myMethod(), there is an instance variable fi_x of the appropriate type. An instance variable target is possibly used to store a target. Finally, a constructor that initializes a new tree-worker and a run()-method that calls a new method myMethod_par_x() with the appropriate parameters are provided:
Constructs involving target are only required if myMethod() is an instance method. For a class method, these constructs are omitted and `MyClass' is used in the call to myMethod_par_x() instead. If myMethod() is a void-method, all constructs involving result are omitted.