/*!
  \page ktexttemplate-internals
  \title Internals

  \note This page is intended only to be informative for new contributors to KTextTemplate or people who are really interested in this kind of thing. These are implementation details and are likely to change without notice.

  \section1 How KTextTemplate works.

  A template string is first tokenized by the Lexer class. The result is a list of tokens with content which can be of type \c TextToken, \c CommentToken, \c VariableToken or \c TagToken.

  The tokens are further processed by the Parser class. The Parser generates nodes from the token stream. For a \c TextToken it generates a \c TextNode, for a \c CommentToken it generates nothing, for a \c VariableToken it generates a \c VariableNode, and for a \c TagToken it generates another type of Node determined by available plugins. Some plugins are built in, and others may be loaded by the template itself using the \c load tag, or preloaded by the application developer.

  The plugin uses the Abstract Factory Pattern. It returns a list of concrete factories, one for each tag handled by that plugin. The factories have a \c getNode method which accepts the tag content and the active parser as an argument and returns a concrete Node. The \c getNode method may advance the parser in the case of begin/end tags etc. When the parser is finished, it has created a tree of nodes, which is essentially a Template object.

  A Template is rendered with a Context object. During rendering, each node in the template has its \c render method called with the Context. The Node may contain different sub-trees, one of which is rendered, as is the case for \c IfNode, or it might contain a single sub-tree which is rendered multiple times, as in the case of \c ForNode, etc. The rendering outputs a string, which is the rendered output of the Template for a particular Context. A single Template may be rendered multiple times with mutliple different Contexts.

  Plugins can return Filter and AbstractNodeFactory instances. Filters can manipulate Variable instances in some way before rendering them to the output.

  Loading templates to include or extend is accomplished using the \c loadByName methods. The secondary template should use the same state as the initially created/loaded template, so that it uses the same template loaders, has the same plugins available by default and uses the same search directories to find additional plugins.

*/
