This is a rough draft of the developer documentation that will give an overview of the modules that comprise TT3.
For end users. Thin facade. Can switch between implementation engines.
Runtime engine. Different engines (e.g. TT2 and TT3) may implement different APIs, functionality, etc.
This is a base class for providers that find and load templates. The Template::TT3::Provider::File module is a subclass for loading templates from the filesystem. Others may follow.
A context is a place to store variable data and provide access to resources like templates, plugins, etc. In TT3 the context object also includes most of the high-level functionality of the TT2 Template::Stash.
Base class object for representing template variables. This is subclassed into specialised objects for different data types: hash arrays, lists, objects, etc.
Scans templates for text and tags. Uses a tagset to define what tags to find.
Defines a set of tags, e.g. the Template::TT3::Tagset::TT3 tagset defines the inline, outline, comment and control tags.
Implements the scanning and tokenising logic for a particular kind of tag. E.g. inline tags are specialised to look out for the end-of-tag token, control tags have effect at compile time, comment tags do nothing.
Collects tokens emitted by the scanner and tags during tokenisation. Each token is represented by an element object. This is a bit of a mess and I'll probably jiggle things around a bit here.
Base class for elements. There's a fair bit of documentation in this module which describes the tokenising and parsing process. It's incomplete (and possibly inaccurate in places), but it's a good start.
This module is then subclasses into umpty different element modules that represent different parts of the TT3 language: text chunks, numbers, words, operators, end so on.
This is a base class visitor module for creating views of a parsed template tree. It is subclasses into two main categories for views working on either a token-based view of the template (e.g. for reconstituting the template source including all whitespace and other ignorable tokens) or an expression based view that operates on the parsed tree.