================================================================================ Simple Enum ================================================================================ enum Foobar { Foo, Bar, } -------------------------------------------------------------------------------- (root (statement (statement_kind (type_definition (enum_definition (identifier) (identifier) (identifier)))))) ================================================================================ Enum with Arguments ================================================================================ enum Foobar { Foo, Bar, } -------------------------------------------------------------------------------- (root (statement (statement_kind (type_definition (enum_definition (identifier) (type_arguments (type (identifier)) (type (identifier))) (identifier) (type_arguments (type (identifier))) (identifier) (type_arguments (type (identifier)))))))) ================================================================================ Complex Enum ================================================================================ enum Foobar { Foo, Bar, Baz> } -------------------------------------------------------------------------------- (root (statement (statement_kind (type_definition (enum_definition (identifier) (type_arguments (type (identifier))) (identifier) (type_arguments (type (identifier))) (identifier) (type_arguments (type) (type)) (identifier) (type_arguments (type (identifier) (type (identifier))))))))) ================================================================================ Simple Enum Instance ================================================================================ Foobar::Foo -------------------------------------------------------------------------------- (root (statement (statement_kind (expression (value (enum_instance (identifier) (identifier))))))) ================================================================================ Nested Enum Instance ================================================================================ FooBar::Bar(BazBuf::Baz(123)) -------------------------------------------------------------------------------- (root (statement (statement_kind (expression (value (enum_instance (identifier) (identifier) (expression (value (enum_instance (identifier) (identifier) (expression (value (integer))))))))))))