TT3: /home/abw/web/london/tt3/slides/examples/html_loopified2.tt3
Source
Tokens
Tree
Variables
Output
Template Source
[?
HTML_CMDS
ul
li
a
?]
[%
ul
for
'One Two Three'
.
split
li
"Example $item"
%]
--EOF--
Source Tokens
tag_start
@0
[?
whitespace
@2
control htmlcmds
@3
HTML_CMDS
whitespace
@12
variable
@13
ul
whitespace
@15
variable
@16
li
whitespace
@18
variable
@19
a
whitespace
@20
tag_end
@21
?]
text
@23
\n\n
tag_start
@25
[%
whitespace
@27
html ul
@28
ul
whitespace
@30
\n
command for
@37
for
whitespace
@40
squote string
@41
'One Two Three'
operator dot
@56
.
word
@57
split
whitespace
@62
\n
html li
@71
li
whitespace
@73
dquote
@74
"Example $item"
whitespace
@89
\n
tag_end
@91
%]
text
@93
\n
eof
@94
Parse Tree
text
@23
\n\n
html keyword element
@28
ul
for keyword
@37
for
List
binary expr
@56
'One Two Three'.split
squote string element
@41
'One Two Three'
.
word element
@57
split
Then
html keyword element
@71
li
dquote string element
@74
"Example $item"
text
@75
Example
variable element
@84
item
text
@93
\n
Variables Used
item
Uses
@ line 5
li "Example $
item
"
Generated Output
<ul><li>Example One</li><li>Example Two</li><li>Example Three</li></ul>