Suggestion: add possible types list as comments for properties
It would be very useful to be able to understand which types can be present in node.Node properties.
For example, I initially thought that (*expr.Variable).VarName can only be *node.Identifier but very much later I saw that it is not always the case as there exist "variable variables".
Type comments can be created automatically using actual type information when analyzing some big codebase. I may volunteer for that if you do not have plans to implement it yourself.
Your idea with comments is excellent. I also have planned to create a wiki that describes every node type and refactor nodes that can contain the only concrete type of child node.
The better way to get possible child nodes types is analyzed BNF rules.
refactor nodes that can contain the only concrete type of child node
Yes, that would be great although I doubt there will be a lot of nodes of this type.
The better way to get possible child nodes types is analyzed BNF rules.
Yes, you are right. My approach may not give all possible types but it can give statistics on how often each type can be encountered (even though I doubt it is a good idea to include it in code documentation).