Package net.sourceforge.templat.lexer

Translates a template into a list of tokens.

See:
          Description

Interface Summary
TemplateToken Represents a token, as output from TemplateLexer.
 

Class Summary
ElseToken else @
EndIfToken end if @
EndLoopToken end loop @
IfToken if ( boolean-expression ) @
IncludeToken include template-pathargument1argument2... ) @
LoopToken loop variable : count-expression @
StringToken Represents areas of the template that are outside of any tag.
TemplateDeclarationToken template template-nameparameter1parameter2... ) @
TemplateLexer Lexer to analyze a given template and fully tokenize its contents.
ValueToken expression @
 

Package net.sourceforge.templat.lexer Description

Translates a template into a list of tokens.

Lexing is the process of converting an input stream of characters into a list of meaningful tokens. Lexing the template is the first step in the rendering process.

The TemplateLexer class performs the lexing. It reads the template and generates instances of the appropriate TemplateTokens to represent the entire template. The list of tokens would then typically be passed to the TemplateParser.

TemplateToken is an interface; the actual token classes implement this interface. The token classes represent either a section of the template copied verbatim (StringToken), or one of the tags: if, else, end-if, loop, end-loop, template (definition), include, or an expression (ValueToken).

Since parsing expressions is complicated, this processing is handled in a separate package, net.sourceforge.templat.expr. Expressions are not only found in the expression tag, but also in the if tag (the condition), the include tag (the arguments), and the loop tag (the loop count).