First of all thank you for taking your time!
I actually already started writing a visitor but didn't have time to finish it yet so I'm not yet sure if it works. I didn't however know of the visitors syn
provides, so that will obviously be a much much easier task now xD
So currently I think I need an Path
visitor and have to check for each path if the first identifier of it equals the identifier of the generic parameter. This however is just a guess and I'm not sure if it will be correct in all cases. Might however be good enough...
For your second approach:
Albeit for a different reason the possibility of having the generic parameters on the Builder struct itself and its downside already came up in my other question and if possible I would like to prevent it
I do think however the visitor is the correct approach, so I will mark the question as answered