TT3: /home/abw/web/london/tt3/slides/examples/math_operators.tt3
Source
Tokens
Tree
Variables
Output
Template Source
[%
# all the usual mathematical operators
a
**
b
a
*
b
a
/
b
a
+
b
a
-
b
a
%
b
a
div
b
a
mod
b
%]
--EOF--
Source Tokens
tag_start
@0
[%
whitespace
@2
# all the usual mathematical operators\n
variable
@47
a
whitespace
@48
number power
@49
**
whitespace
@51
variable
@52
b
whitespace
@53
\n
variable
@58
a
whitespace
@59
number multiply
@60
*
whitespace
@61
variable
@62
b
whitespace
@63
\n
variable
@68
a
whitespace
@69
number divide
@70
/
whitespace
@71
variable
@72
b
whitespace
@73
\n
variable
@78
a
whitespace
@79
number add
@80
+
whitespace
@81
variable
@82
b
whitespace
@83
\n
variable
@88
a
whitespace
@89
number subtract
@90
-
whitespace
@91
variable
@92
b
whitespace
@93
\n
variable
@98
a
number percent
@99
%
variable
@102
b
whitespace
@103
\n
variable
@108
a
whitespace
@109
number divint
@110
div
whitespace
@113
variable
@114
b
whitespace
@115
\n
variable
@120
a
whitespace
@121
number modulus
@122
mod
whitespace
@125
variable
@126
b
whitespace
@127
\n
tag_end
@128
%]
eof
@130
Parse Tree
binary expr
@49
a ** b
variable element
@47
a
**
variable element
@52
b
binary expr
@60
a * b
variable element
@58
a
*
variable element
@62
b
binary expr
@70
a / b
variable element
@68
a
/
variable element
@72
b
binary expr
@80
a + b
variable element
@78
a
+
variable element
@82
b
binary expr
@90
a - b
variable element
@88
a
-
variable element
@92
b
binary expr
@99
a % b
variable element
@98
a
%
variable element
@102
b
binary expr
@110
a div b
variable element
@108
a
div
variable element
@114
b
binary expr
@122
a mod b
variable element
@120
a
mod
variable element
@126
b
Variables Used
a
Uses
@ line 2
a
** b
@ line 3
a
* b
@ line 4
a
/ b
@ line 5
a
+ b
@ line 6
a
- b
@ line 7
a
% b
@ line 8
a
div b
@ line 9
a
mod b
b
Uses
@ line 2
a **
b
@ line 3
a *
b
@ line 4
a /
b
@ line 5
a +
b
@ line 6
a -
b
@ line 7
a %
b
@ line 8
a div
b
@ line 9
a mod
b
Generated Output
TT3 undefined data error at line 2 of /home/abw/web/london/tt3/slides/examples/math_operators.tt3:
Error:
Undefined value returned by expression: a
Source:
a ** b
^ here