Why do you need a BasePathVisitor ? It is useless isn't it ? you might want to define your visitor elsewhere (and with a more specific name.