58 @astLoadSCOPEBEGIN , _
74 (AST_NODECLASS_ASSIGN, AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"let" ), _
75 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"+=" , AST_OP_ADD ), _
76 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"-=" , AST_OP_SUB ), _
77 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"*=" , AST_OP_MUL ), _
78 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"/=" , AST_OP_DIV ), _
79 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"/=" , AST_OP_INTDIV ), _
80 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"mod=" , AST_OP_MOD ), _
81 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"and=" , AST_OP_AND ), _
82 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"or=" , AST_OP_OR ), _
83 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"andalso=", AST_OP_ANDALSO), _
84 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"orelse=" , AST_OP_ORELSE ), _
85 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"xor=" , AST_OP_XOR ), _
86 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"eqv=" , AST_OP_EQV ), _
87 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"imp=" , AST_OP_IMP ), _
88 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"shl=" , AST_OP_SHL ), _
89 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"shr=" , AST_OP_SHR ), _
90 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"pow=" , AST_OP_POW ), _
91 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"&=" , AST_OP_CONCAT ), _
92 (AST_NODECLASS_MEM , AST_OPFLAGS_SELF, @
"new" ), _
93 (AST_NODECLASS_MEM , AST_OPFLAGS_SELF, @
"new[]" ), _
94 (AST_NODECLASS_MEM , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"delete" ), _
95 (AST_NODECLASS_MEM , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"delete[]"), _
96 (AST_NODECLASS_ADDROF, AST_OPFLAGS_SELF, @
"@" ), _
97 (AST_NODECLASS_BOP , AST_OPFLAGS_SELF, @
"[]" ), _
98 (AST_NODECLASS_COMP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"for" ), _
99 (AST_NODECLASS_COMP , AST_OPFLAGS_SELF
or AST_OPFLAGS_NORES, @
"step" ), _
100 (AST_NODECLASS_COMP , AST_OPFLAGS_SELF, @
"next" ), _
101 (AST_NODECLASS_CONV , AST_OPFLAGS_SELF, @
"cast" ), _
102 (AST_NODECLASS_BOP , AST_OPFLAGS_COMM, @
"+" , AST_OP_ADD_SELF ), _
103 (AST_NODECLASS_BOP , AST_OPFLAGS_NONE, @
"-" , AST_OP_SUB_SELF ), _
104 (AST_NODECLASS_BOP , AST_OPFLAGS_COMM, @
"*" , AST_OP_MUL_SELF ), _
105 (AST_NODECLASS_BOP , AST_OPFLAGS_NONE, @
"/" , AST_OP_DIV_SELF ), _
106 (AST_NODECLASS_BOP , AST_OPFLAGS_NONE, @
"/" , AST_OP_INTDIV_SELF ), _
107 (AST_NODECLASS_BOP , AST_OPFLAGS_NONE, @
"mod" , AST_OP_MOD_SELF ), _
108 (AST_NODECLASS_BOP , AST_OPFLAGS_COMM, @
"and" , AST_OP_AND_SELF ), _
109 (AST_NODECLASS_BOP , AST_OPFLAGS_COMM, @
"or" , AST_OP_OR_SELF ), _
110 (AST_NODECLASS_BOP , AST_OPFLAGS_COMM, @
"andalso", AST_OP_ANDALSO_SELF ), _
111 (AST_NODECLASS_BOP , AST_OPFLAGS_COMM, @
"orelse" , AST_OP_ORELSE_SELF ), _
112 (AST_NODECLASS_BOP , AST_OPFLAGS_COMM, @
"xor" , AST_OP_XOR_SELF ), _
113 (AST_NODECLASS_BOP , AST_OPFLAGS_NONE, @
"eqv" , AST_OP_EQV_SELF ), _
114 (AST_NODECLASS_BOP , AST_OPFLAGS_NONE, @
"imp" , AST_OP_IMP_SELF ), _
115 (AST_NODECLASS_BOP , AST_OPFLAGS_NONE, @
"shl" , AST_OP_SHL_SELF ), _
116 (AST_NODECLASS_BOP , AST_OPFLAGS_NONE, @
"shr" , AST_OP_SHR_SELF ), _
117 (AST_NODECLASS_BOP , AST_OPFLAGS_NONE, @
"pow" , AST_OP_POW_SELF ), _
118 (AST_NODECLASS_BOP , AST_OPFLAGS_NONE, @
"&" , AST_OP_CONCAT_SELF ), _
119 (AST_NODECLASS_COMP , AST_OPFLAGS_COMM, @
"=" ), _
120 (AST_NODECLASS_COMP , AST_OPFLAGS_NONE, @
">" ), _
121 (AST_NODECLASS_COMP , AST_OPFLAGS_NONE, @
"<" ), _
122 (AST_NODECLASS_COMP , AST_OPFLAGS_COMM, @
"<>" ), _
123 (AST_NODECLASS_COMP , AST_OPFLAGS_NONE, @
">=" ), _
124 (AST_NODECLASS_COMP , AST_OPFLAGS_NONE, @
"<=" ), _
125 (AST_NODECLASS_COMP , AST_OPFLAGS_NONE, @
"is" ), _
126 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"not" ), _
127 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"+" ), _
128 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"-" ), _
129 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"HADD" ), _
130 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"abs" ), _
131 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"sgn" ), _
132 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"sin" ), _
133 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"asin" ), _
134 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"cos" ), _
135 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"acos" ), _
136 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"tan" ), _
137 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"atan" ), _
138 (AST_NODECLASS_BOP , AST_OPFLAGS_NONE, @
"atn2" ), _
139 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"sqr" ), _
140 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"rsqrt" ), _
141 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"rcp" ), _
142 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"log" ), _
143 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"exp" ), _
144 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"int" ), _
145 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"fix" ), _
146 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"frac" ), _
147 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"convd2s" ), _
148 (AST_NODECLASS_UOP , AST_OPFLAGS_NONE, @
"swzrep" ), _
149 (AST_NODECLASS_ADDROF, AST_OPFLAGS_NONE, @
"*" ), _
150 (AST_NODECLASS_ADDROF, AST_OPFLAGS_NONE, @
"->" ), _
151 (AST_NODECLASS_MEM , AST_OPFLAGS_NONE, @
"new" , AST_OP_NEW_SELF ), _
152 (AST_NODECLASS_MEM , AST_OPFLAGS_NONE, @
"new[]" , AST_OP_NEW_VEC_SELF), _
153 (AST_NODECLASS_MEM , AST_OPFLAGS_NONE, @
"delete" , AST_OP_DEL_SELF ), _
154 (AST_NODECLASS_MEM , AST_OPFLAGS_NONE, @
"delete[]", AST_OP_DEL_VEC_SELF), _
155 (AST_NODECLASS_CONV , AST_OPFLAGS_NONE, @
"cint" ), _
156 (AST_NODECLASS_CONV , AST_OPFLAGS_NONE, @
"cflt" ), _
157 (AST_NODECLASS_LOAD , AST_OPFLAGS_NONE, @
"load" ), _
158 (AST_NODECLASS_LOAD , AST_OPFLAGS_NONE, @
"lres" ), _
159 (AST_NODECLASS_ASSIGN, AST_OPFLAGS_NONE, @
"spill" ), _
160 (AST_NODECLASS_STACK , AST_OPFLAGS_NONE, @
"push" ), _
161 (AST_NODECLASS_STACK , AST_OPFLAGS_NONE, @
"pop" ), _
162 (AST_NODECLASS_STACK , AST_OPFLAGS_NONE, @
"pudt" ), _
163 (AST_NODECLASS_STACK , AST_OPFLAGS_NONE, @
"stka" ), _
164 (AST_NODECLASS_BRANCH, AST_OPFLAGS_NONE, @
"jeq" ), _
165 (AST_NODECLASS_BRANCH, AST_OPFLAGS_NONE, @
"jgt" ), _
166 (AST_NODECLASS_BRANCH, AST_OPFLAGS_NONE, @
"jlt" ), _
167 (AST_NODECLASS_BRANCH, AST_OPFLAGS_NONE, @
"jne" ), _
168 (AST_NODECLASS_BRANCH, AST_OPFLAGS_NONE, @
"jge" ), _
169 (AST_NODECLASS_BRANCH, AST_OPFLAGS_NONE, @
"jle" ), _
170 (AST_NODECLASS_BRANCH, AST_OPFLAGS_NONE, @
"jmp" ), _
171 (AST_NODECLASS_BRANCH, AST_OPFLAGS_NONE, @
"call" ), _
172 (AST_NODECLASS_BRANCH, AST_OPFLAGS_NONE, @
"lbl" ), _
173 (AST_NODECLASS_BRANCH, AST_OPFLAGS_NONE, @
"ret" ), _
174 (AST_NODECLASS_CALL , AST_OPFLAGS_NONE, @
"calf" ), _
175 (AST_NODECLASS_CALL , AST_OPFLAGS_NONE, @
"calp" ), _
176 (AST_NODECLASS_CALL , AST_OPFLAGS_NONE, @
"jmpp" ), _
177 (AST_NODECLASS_MEM , AST_OPFLAGS_NONE, @
"mmov" ), _
178 (AST_NODECLASS_MEM , AST_OPFLAGS_NONE, @
"mswp" ), _
179 (AST_NODECLASS_MEM , AST_OPFLAGS_NONE, @
"mclr" ), _
180 (AST_NODECLASS_MEM , AST_OPFLAGS_NONE, @
"stkc" ), _
181 (AST_NODECLASS_DBG , AST_OPFLAGS_NONE, @
"lini" ), _
182 (AST_NODECLASS_DBG , AST_OPFLAGS_NONE, @
"lend" ), _
183 (AST_NODECLASS_DBG , AST_OPFLAGS_NONE, @
"sini" ), _
184 (AST_NODECLASS_DBG , AST_OPFLAGS_NONE, @
"send" ), _
185 (AST_NODECLASS_LIT , AST_OPFLAGS_NONE, @
"rem" ), _
186 (AST_NODECLASS_LIT , AST_OPFLAGS_NONE, @
"asm" ) _
192 1, 3, 7, 15, 31, 63, 127, 255, _
193 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, _
194 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215, _
195 33554431, 67108863, 134217727, 268435455, 536870911, 1073741823, 2147483647, 4294967295 _
199 listInit( @
ast.astTB, AST_INITNODES,
len( ASTNODE ), LIST_FLAGS_NOCLEAR )
203 ast.bitfieldcount = 0
205 ast.warn_convoverflow = TRUE
212 listInit( @
ast.asmtoklist, 16,
sizeof( ASTASMTOK ), LIST_FLAGS_NOCLEAR )
228 dim as ASTNODE
ptr c =
any, t =
any
236 c =
astNewNode( INVALID, FB_DATATYPE_INVALID )
250 select case( n->
class )
251 case AST_NODECLASS_VAR
255 if( symbIsVar( c->sym )
and symbIsTemp( c->sym ) )
then
261 case AST_NODECLASS_CALL
266 case AST_NODECLASS_IIF
269 case AST_NODECLASS_LOOP
272 case AST_NODECLASS_TYPEINI
273 ast.typeinicount += 1
278 c->typeini.scp = NULL
280 case AST_NODECLASS_FIELD
281 if( astGetDataType( c->l ) = FB_DATATYPE_BITFIELD )
then
282 ast.bitfieldcount += 1
286 case AST_NODECLASS_LIT, AST_NODECLASS_JMPTB
301 dim as FBSYMBOL
ptr tmp =
any, subtype =
any
302 dim as integer dtype =
any
303 dim as ASTNODE
ptr t =
any
310 dtype = astGetFullType( n )
311 subtype = astGetSubType( n )
313 select case as const typeGet( dtype )
315 case FB_DATATYPE_STRUCT, _
316 FB_DATATYPE_STRING, FB_DATATYPE_FIXSTR, FB_DATATYPE_CHAR, FB_DATATYPE_WCHAR
342 byval n
as ASTNODE
ptr _
345 dim as ASTNODE
ptr t =
any
353 if( n->
class = AST_NODECLASS_CALL )
then
376 byval class_
as integer, _
377 byval dtype
as integer, _
378 byval subtype
as FBSYMBOL
ptr _
383 astInitNode( n, class_, dtype, subtype )
392 byval n
as ASTNODE
ptr _
399 if( astIsVAR( n ) )
then
401 if( symbIsVar( n->sym )
and symbIsTemp( n->sym ) )
then
414 byval op as integer _
417 select case as const op
436 function astLoad(
byval n
as ASTNODE
ptr )
as IRVREG
ptr