added a comment - - edited
Current patch - includes a little bit of refactoring (sorry - haven't had time to split that out yet).
Status: handles @Grab and @Grapes on all kinds of imports and on package statements
Questions: Should there be a common abstract class or interface for:
Currently we tend not to use interfaces in this part of the code but we might need interfaces to make VariableExpression annotated soon anyway.
The alternative which I should have considered earlier would be a common class with isStar and isStatic properties. It would be a little bit of a strange beast though as it would have a strange mix of fields only used depending on the values of the flags. Even so, one slightly awkward class might be less cumbersome than 4 classes. The idea would be to make the default values of the isStar and isStatic fields such that it would default back to the current behavior of the class.
Should the redundancy in ModuleNode be removed? e.g. staticImportFields could be derived from staticImportNodes
Which methods should be made deprecated? Or leave in for convenience?
Is current visiting logic acceptable? It will visit imports/package def'ns multiple times for the case of multiple classes in a file. Alternative would be some kind of visitModule logic.