TT3: /home/abw/web/london/tt3/slides/examples/math_operators.tt3

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@47a
whitespace@48
number power@49**
whitespace@51
variable@52b
whitespace@53\n
variable@58a
whitespace@59
number multiply@60*
whitespace@61
variable@62b
whitespace@63\n
variable@68a
whitespace@69
number divide@70/
whitespace@71
variable@72b
whitespace@73\n
variable@78a
whitespace@79
number add@80+
whitespace@81
variable@82b
whitespace@83\n
variable@88a
whitespace@89
number subtract@90-
whitespace@91
variable@92b
whitespace@93\n
variable@98a
number percent@99 %
variable@102b
whitespace@103\n
variable@108a
whitespace@109
number divint@110div
whitespace@113
variable@114b
whitespace@115\n
variable@120a
whitespace@121
number modulus@122mod
whitespace@125
variable@126b
whitespace@127\n
tag_end@128%]
eof@130

Parse Tree

binary expr@49a ** b
variable element@47a
**
variable element@52b
binary expr@60a * b
variable element@58a
*
variable element@62b
binary expr@70a / b
variable element@68a
/
variable element@72b
binary expr@80a + b
variable element@78a
+
variable element@82b
binary expr@90a - b
variable element@88a
-
variable element@92b
binary expr@99a % b
variable element@98a
%
variable element@102b
binary expr@110a div b
variable element@108a
div
variable element@114b
binary expr@122a mod b
variable element@120a
mod
variable element@126b

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