TT3: /home/abw/web/london/tt3/slides/examples/assign_block.tt3
Source
Tokens
Tree
Variables
Output
Template Source
[%
message
=
block
%]
Hello
[%
name
or
'World'
%]
!
[%
end
%]
[%
message
is
%]
Hello
[%
name
or
'World'
%]
!
[%
end
%]
--EOF--
Source Tokens
tag_start
@0
[%
whitespace
@2
variable
@3
message
whitespace
@10
operator assign
@11
=
whitespace
@12
command block
@13
block
whitespace
@18
tag_end
@19
%]
text
@21
\nHello
tag_start
@28
[%
whitespace
@30
variable
@31
name
whitespace
@35
binary operator
@36
or
whitespace
@38
squote string
@39
'World'
whitespace
@46
tag_end
@47
%]
text
@49
!\n
tag_start
@51
[%
whitespace
@53
end
@54
end
whitespace
@57
tag_end
@58
%]
text
@60
\n\n
tag_start
@62
[%
whitespace
@64
variable
@65
message
whitespace
@72
command is
@73
is
whitespace
@75
tag_end
@76
%]
text
@78
\nHello
tag_start
@85
[%
whitespace
@87
variable
@88
name
whitespace
@92
binary operator
@93
or
whitespace
@95
squote string
@96
'World'
whitespace
@103
tag_end
@104
%]
text
@106
!\n
tag_start
@108
[%
whitespace
@110
end
@111
end
whitespace
@114
tag_end
@115
%]
text
@117
\n\n
eof
@119
Parse Tree
binary expr
@11
message = block
variable element
@3
message
=
block keyword
@13
block
Block
text
@21
\nHello
binary expr
@36
name or 'World'
variable element
@31
name
or
squote string element
@39
'World'
text
@49
!\n
text
@60
\n\n
is keyword
@73
message is { "\nHello "; name or 'World'; "!\n" }
variable element
@65
message
is
text
@78
\nHello
binary expr
@93
name or 'World'
variable element
@88
name
or
squote string element
@96
'World'
text
@106
!\n
text
@117
\n\n
Variables Used
message
Uses
@ line 1
[%
message
= block %]
@ line 5
[%
message
is %]
name
Uses
@ line 2
Hello [%
name
or 'World' %]!
@ line 6
Hello [%
name
or 'World' %]!
Generated Output