Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.