Hacker News new | past | comments | ask | show | jobs | submit login

Roslyn specifically does not include parent pointers in its immutable AST nodes. It must do this in order to share those nodes between different versions of the tree.

It only introduces parent pointers in a convenience wrapper layer, built on-demand as you traverse the tree - you could equivalently just pass the parent down as an argument to your tree walking functions.

(The ownership problem of parent pointers also goes away when you use the arena allocation approach that the post arrives at.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: