For the AST I use for my parsers, I always have a root object with a reference to a location object. This is what I did for the JUnit test of my proposition. It perfectly fits my needs, but of course there can be other use cases.

The AST object I use implements a Visitor pattern then I can iterate through the tree whithout having to deal with an external Map. This allows for instance to find a node by a cursor position.

I'm not sure the source substring image is very useful. Otherwise it can be useful to have a reference to the parsed file name. I've already implemented this with the module, I will put it in github shortly.

I believe the interceptor method could be a better solution, but it's more difficult to implement than what is done now.