How can I build a different AST node type for each token type?

This is the same as asking "how do I build heterogeneous trees?"

At the moment, the answer is simply to override create(Token) in a TreeAdaptor such as CommonTreeAdaptor and then create different nodes depending on the incoming token type. This does not allow you to build different object types depending on the context, just the token type. I need to enhance v3 to allow this (similar to how v2 does it), but I've not gotten to it.

As of v3.1, you can specify tree node types on the individual tokens as well: Heterogeneous tree construction.