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

Template Source

[% # self-modifying operators a++ ; ++a ; a-- ; --a ; a += 10 a -= 10 a *= 10 a /= 10 a ~= b a &&= c a ||= b a !!= b %] --EOF--

Source Tokens

tag_start@0[%
whitespace@2 # self-modifying operators\n
variable@35a
number postinc@36++
whitespace@38
delimiter@39;
whitespace@40
number preinc@41++
variable@43a
whitespace@44
delimiter@45;
whitespace@46\n
variable@51a
number postdec@52--
whitespace@54
delimiter@55;
whitespace@56
number predec@57--
variable@59a
whitespace@60
delimiter@61;
whitespace@62\n
variable@67a
whitespace@68
number addset@69+=
whitespace@71
number@7210
whitespace@74\n
variable@79a
whitespace@80
number subset@81-=
whitespace@83
number@8410
whitespace@86\n
variable@91a
whitespace@92
number mulset@93*=
whitespace@95
number@9610
whitespace@98\n
variable@103a
whitespace@104
number divset@105/=
whitespace@107
number@10810
whitespace@110\n
variable@115a
whitespace@116
text combineset@117~=
whitespace@119
variable@120b
whitespace@121\n
variable@126a
whitespace@127
boolean andset@128&&=
whitespace@131
variable@132c
whitespace@133\n
variable@138a
whitespace@139
boolean orset@140||=
whitespace@143
variable@144b
whitespace@145\n
variable@150a
whitespace@151
boolean norset@152!!=
whitespace@155
variable@156b
whitespace@157\n
tag_end@158%]
text@160\n
eof@161

Parse Tree

postfix unary expr@36a++
variable element@35a
++
prefix unary expr@41++a
++
variable element@43a
postfix unary expr@52a--
variable element@51a
--
prefix unary expr@57--a
--
variable element@59a
binary expr@69a += 10
variable element@67a
+=
number element@7210
binary expr@81a -= 10
variable element@79a
-=
number element@8410
binary expr@93a *= 10
variable element@91a
*=
number element@9610
binary expr@105a /= 10
variable element@103a
/=
number element@10810
binary expr@117a ~= b
variable element@115a
~=
variable element@120b
binary expr@128a &&= c
variable element@126a
&&=
variable element@132c
binary expr@140a ||= b
variable element@138a
||=
variable element@144b
binary expr@152a !!= b
variable element@150a
!!=
variable element@156b
text@160\n

Variables Used

a
Uses
@ line 2 a++ ; ++a ;
@ line 2 a++ ; ++a ;
@ line 3 a-- ; --a ;
@ line 3 a-- ; --a ;
@ line 4 a += 10
@ line 5 a -= 10
@ line 6 a *= 10
@ line 7 a /= 10
@ line 8 a ~= b
@ line 9 a &&= c
@ line 10 a ||= b
@ line 11 a !!= b
b
Uses
@ line 8 a ~= b
@ line 10 a ||= b
@ line 11 a !!= b
c
Uses
@ line 9 a &&= c

Generated Output

TT3 undefined data error at line 2 of /home/abw/web/london/tt3/slides/examples/self_modifying_operators.tt3:
Error: Undefined value returned by expression: a
Source: a++ ; ++a ;
^ here