TT3: /home/abw/web/london/tt3/slides/examples/self_modifying_operators.tt3
Source
Tokens
Tree
Variables
Output
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
@35
a
number postinc
@36
++
whitespace
@38
delimiter
@39
;
whitespace
@40
number preinc
@41
++
variable
@43
a
whitespace
@44
delimiter
@45
;
whitespace
@46
\n
variable
@51
a
number postdec
@52
--
whitespace
@54
delimiter
@55
;
whitespace
@56
number predec
@57
--
variable
@59
a
whitespace
@60
delimiter
@61
;
whitespace
@62
\n
variable
@67
a
whitespace
@68
number addset
@69
+=
whitespace
@71
number
@72
10
whitespace
@74
\n
variable
@79
a
whitespace
@80
number subset
@81
-=
whitespace
@83
number
@84
10
whitespace
@86
\n
variable
@91
a
whitespace
@92
number mulset
@93
*=
whitespace
@95
number
@96
10
whitespace
@98
\n
variable
@103
a
whitespace
@104
number divset
@105
/=
whitespace
@107
number
@108
10
whitespace
@110
\n
variable
@115
a
whitespace
@116
text combineset
@117
~=
whitespace
@119
variable
@120
b
whitespace
@121
\n
variable
@126
a
whitespace
@127
boolean andset
@128
&&=
whitespace
@131
variable
@132
c
whitespace
@133
\n
variable
@138
a
whitespace
@139
boolean orset
@140
||=
whitespace
@143
variable
@144
b
whitespace
@145
\n
variable
@150
a
whitespace
@151
boolean norset
@152
!!=
whitespace
@155
variable
@156
b
whitespace
@157
\n
tag_end
@158
%]
text
@160
\n
eof
@161
Parse Tree
postfix unary expr
@36
a++
variable element
@35
a
++
prefix unary expr
@41
++a
++
variable element
@43
a
postfix unary expr
@52
a--
variable element
@51
a
--
prefix unary expr
@57
--a
--
variable element
@59
a
binary expr
@69
a += 10
variable element
@67
a
+=
number element
@72
10
binary expr
@81
a -= 10
variable element
@79
a
-=
number element
@84
10
binary expr
@93
a *= 10
variable element
@91
a
*=
number element
@96
10
binary expr
@105
a /= 10
variable element
@103
a
/=
number element
@108
10
binary expr
@117
a ~= b
variable element
@115
a
~=
variable element
@120
b
binary expr
@128
a &&= c
variable element
@126
a
&&=
variable element
@132
c
binary expr
@140
a ||= b
variable element
@138
a
||=
variable element
@144
b
binary expr
@152
a !!= b
variable element
@150
a
!!=
variable element
@156
b
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