One can define literal syntax for a new class using the The parser together with corresponding prettyprinting methods which print instances of the class using this syntax.
Literal prettyprinting protocol
Prettyprinting more complex literals

The prettyprinter actually exposes a general source code output engine and is not limited to printing object structure.
Prettyprinter sections