rzwitserloot / lombok.ast

Robust parser + AST for the java language.
http://projectlombok.org/
MIT License
71 stars 22 forks source link

This is useful for the Android Lint usage of Lombok.AST #4

Closed tnorbye closed 11 years ago

tnorbye commented 11 years ago

The native node field (a plain Object) is available for the AST converters to keep a reference to the original AST node corresponding to the Lombok node. This node can then be used later to do type resolution (using a type helper, specific to each AST, which casts the native nodes back and performs AST specific logi).

It can also be used to lazily compute positions. This is useful for lint, where a lot of node information is unused. In order to make this work without an external helper, it also stashes a reference to a PositionFactory, supplied by the AST transformer, which lazily creates Position objects on the fly.