TT3: /home/abw/web/london/tt3/slides/examples/just.tt3
Source
Tokens
Tree
Variables
Output
Template Source
[%
just
x
=
10
,
y
=
20
{
# x and y are the only variables
# defined within this block
z
=
x
+
y
;
}
%]
--EOF--
Source Tokens
tag_start
@0
[%
whitespace
@2
command just
@4
just
whitespace
@8
variable
@9
x
operator assign
@10
=
number
@11
10
separator
@13
,
whitespace
@14
variable
@15
y
operator assign
@16
=
number
@17
20
whitespace
@19
construct hash
@20
{
whitespace
@21
\n # x and y are the only variables \n # defined within this block\n
variable
@108
z
whitespace
@109
operator assign
@110
=
whitespace
@111
variable
@112
x
whitespace
@113
number add
@114
+
whitespace
@115
variable
@116
y
delimiter
@117
;
whitespace
@118
\n
terminator
@123
}
whitespace
@124
\n
tag_end
@125
%]
text
@127
\n
eof
@128
Parse Tree
just keyword
@4
just
Data
binary expr
@10
x = 10
variable element
@9
x
=
number element
@11
10
binary expr
@16
y = 20
variable element
@15
y
=
number element
@17
20
Block
binary expr
@110
z = x + y
variable element
@108
z
=
binary expr
@114
x + y
variable element
@112
x
+
variable element
@116
y
text
@127
\n
Variables Used
x
Uses
@ line 4
z =
x
+ y;
@ line 1
[% just
x
=10, y=20 {
y
Uses
@ line 4
z = x +
y
;
@ line 1
[% just x=10,
y
=20 {
z
Uses
@ line 4
z
= x + y;
Generated Output