This is a rough draft of the developer documentation that will describe how compiled templates are represented using an element tree.
The hierarchy of elements is as follows:
Element Literal Text Padding String Squote Dquote Whitespace Comment Delimiter TagEnd Terminator End
There are more... but I haven't cleaned those up yet
Base class for all elements that represent a chunk of literal text.
An element representing a synthesised padding token. e.g. the single space
added around a tag by the =
pre/post chomp flags.
A subclass of Template::TT3::Element::String for 'single quoted' strings.
A subclass of Template::TT3::Element::String for "double quoted" strings.
An element representing am expression delimiter. This includes the semi-colon,
;
, and the end of tag tokens (e.g. %]
, ?]
, etc) represented by the
Template::TT3::Element::TagEnd
subclass.
A thin subclass of
Template::TT3::Element::Delimiter
for representing
end of tag tokens (e.g. %]
, ?]
, etc)
An element representing a terminator token. e.g. the end
keyword and
the ]
, }
and )
tokens used to terminate lists, hash arrays and
parameter lists.
A thin subclass of Template::TT3::Element::Terminator which acts like a keyword when presented via a view (e.g. for the purpose of syntax highlighting).
Andy Wardley http://wardley.org/