14 byval l as ASTNODE
ptr, _
15 byval ldclass
as FB_DATACLASS, _
16 byval r
as ASTNODE
ptr, _
17 byval rdclass
as FB_DATACLASS _
20 dim as ASTNODE
ptr other =
any
26 if( ldclass = FB_DATACLASS_STRING )
then
32 select case( astGetDataType( other ) )
33 case FB_DATATYPE_CHAR, FB_DATATYPE_WCHAR
45 byval l as ASTNODE
ptr, _
46 byval ldclass
as FB_DATACLASS, _
47 byref r
as ASTNODE
ptr, _
48 byval rdclass
as FB_DATACLASS, _
49 byval checkOnly
as integer =
TRUE _
52 dim as FBSYMBOL
ptr proc =
any
57 if( astGetDataType(
l ) <> FB_DATATYPE_STRUCT )
then
61 if(
l->
class = AST_NODECLASS_CALL )
then
67 if( astGetDataType( r ) <> FB_DATATYPE_STRUCT )
then
72 if(
l->subtype <> r->subtype )
then
79 if( checkOnly = FALSE )
then
91 byval l as ASTNODE
ptr, _
92 byref ldfull
as integer, _
93 byval r
as ASTNODE
ptr, _
94 byref rdfull
as integer, _
95 byref is_zstr
as integer _
100 dim as integer ldtype =
any, rdtype =
any
102 ldtype = typeGet( ldfull )
103 rdtype = typeGet( rdfull )
106 if( ldtype = FB_DATATYPE_WCHAR )
then
109 is_zstr = (rdtype = FB_DATATYPE_CHAR)
113 is_zstr = (ldtype = FB_DATATYPE_CHAR)
122 if( ldtype = FB_DATATYPE_WCHAR )
then
124 if( astIsDEREF(
l ) = FALSE )
then
130 ldfull = typeJoin( ldfull, env.target.wchar )
133 if( astIsDEREF( r ) = FALSE )
then
137 rdfull = typeJoin( rdfull, env.target.wchar )
145 byval l as ASTNODE
ptr, _
146 byref ldfull
as integer, _
147 byval r
as ASTNODE
ptr, _
148 byref rdfull
as integer _
154 if( typeGet( ldfull ) = FB_DATATYPE_CHAR )
then
156 if( astIsDEREF(
l ) = FALSE )
then
160 ldfull = typeJoin( ldfull, FB_DATATYPE_UBYTE )
163 if( astIsDEREF( r ) = FALSE )
then
167 rdfull = typeJoin( rdfull, FB_DATATYPE_UBYTE )
176 byval l as ASTNODE
ptr, _
177 byval ldclass
as FB_DATACLASS, _
178 byval r
as ASTNODE
ptr, _
179 byval rdclass
as FB_DATACLASS _
183 if( astGetDataType(
l ) <> astGetDataType( r ) )
then
184 if( (ldclass <> FB_DATACLASS_INTEGER)
or _
185 (rdclass <> FB_DATACLASS_INTEGER) )
then
194 byval l as ASTNODE
ptr, _
195 byval ldtype
as FB_DATATYPE, _
196 byval r
as ASTNODE
ptr, _
197 byval rdtype
as FB_DATATYPE _
208 if( typeIsPtr( ldtype ) )
then
210 if( typeGetClass( rdtype ) = FB_DATACLASS_FPOINT )
then
216 if( typeGetDtOnly( ldtype ) = FB_DATATYPE_STRUCT
and typeGetDtOnly( rdtype ) = FB_DATATYPE_STRUCT )
then
230 elseif( typeIsPtr( rdtype ) )
then
232 if( typeGetClass( ldtype ) = FB_DATACLASS_FPOINT )
then
244 byval l as ASTNODE
ptr, _
245 byval r
as ASTNODE
ptr _
248 dim as ASTNODE
ptr n =
any
249 dim as FB_DATATYPE ldtype =
any, rdtype =
any, ldfull =
any, rdfull =
any
250 dim as FB_DATACLASS ldclass =
any, rdclass =
any
254 ldfull = astGetFullType(
l )
255 rdfull = astGetFullType( r )
256 ldtype = typeGet( ldfull )
257 rdtype = typeGet( rdfull )
258 ldclass = typeGetClass( ldtype )
259 rdclass = typeGetClass( rdtype )
262 if( (ldclass = FB_DATACLASS_STRING)
or _
263 (rdclass = FB_DATACLASS_STRING) )
then
266 if( ldclass <> rdclass )
then
275 elseif( (ldtype = FB_DATATYPE_STRUCT)
or _
276 (rdtype = FB_DATATYPE_STRUCT) )
then
285 elseif( (ldtype = FB_DATATYPE_WCHAR)
or _
286 (rdtype = FB_DATATYPE_WCHAR) )
then
289 if( ldtype <> rdtype )
then
290 dim as integer is_zstr
300 ldclass = typeGetClass( ldfull )
301 rdclass = typeGetClass( rdfull )
302 ldtype = typeGet( ldfull )
303 rdtype = typeGet( rdfull )
307 elseif( (ldtype = FB_DATATYPE_CHAR)
or _
308 (rdtype = FB_DATATYPE_CHAR) )
then
311 if( ldtype = rdtype )
then
320 ldclass = typeGetClass( ldfull )
321 rdclass = typeGetClass( rdfull )
322 ldtype = typeGet( ldfull )
323 rdtype = typeGet( rdfull )
326 elseif( (ldtype = FB_DATATYPE_ENUM)
or _
327 (rdtype = FB_DATATYPE_ENUM) )
then
337 if( ldtype <> rdtype )
then
339 if( rdclass <> FB_DATACLASS_STRING )
then
341 if( astIsCONST( r ) )
then
359 byval ldtype
as integer, _
360 byval lsubtype
as FBSYMBOL
ptr, _
361 byval r
as ASTNODE
ptr _
364 dim as ASTNODE
ptr l =
any
376 byval l as ASTNODE
ptr, _
377 byval r
as ASTNODE
ptr, _
378 byval options
as AST_OPOPT _
381 dim as ASTNODE
ptr n =
any
382 dim as FB_DATATYPE ldtype =
any, rdtype =
any, ldfull =
any, rdfull =
any
383 dim as FB_DATACLASS ldclass =
any, rdclass =
any
384 dim as FBSYMBOL
ptr lsubtype =
any, proc =
any
385 dim as FB_ERRMSG err_num =
any
386 dim as integer do_move =
any
390 if( (
l = NULL)
or (r = NULL) )
then
394 ldfull = astGetFullType(
l )
395 ldtype = typeGet( ldfull )
396 ldclass = typeGetClass( ldtype )
397 lsubtype =
l->subtype
399 rdfull = astGetFullType( r )
400 rdtype = typeGet( rdfull )
401 rdclass = typeGetClass( rdtype )
405 if( (options
and AST_OPOPT_DONTCHKOPOVL) = 0 )
then
407 dim as integer check_letop =
TRUE
409 select case as const ldtype
410 case FB_DATATYPE_STRUCT
411 if( ldtype = rdtype )
then
412 if(
l->subtype = r->subtype )
then
417 if( (options
and AST_OPOPT_ISINI) = 0 )
then
426 if( check_letop )
then
428 if( proc <> NULL )
then
429 dim as ASTNODE
ptr result =
any
434 if( (options
and AST_OPOPT_ISINI) <> 0 )
then
450 if( err_num <> FB_ERRMSG_OK )
then
457 if( (options
and AST_OPOPT_DONTCHKOPOVL) = 0 )
then
459 if( proc <> NULL )
then
471 if( err_num <> FB_ERRMSG_OK )
then
477 rdfull = astGetFullType( r )
478 rdtype = typeGet( rdfull )
479 rdclass = typeGetClass( rdtype )
482 if( (ldclass = FB_DATACLASS_STRING)
or _
483 (rdclass = FB_DATACLASS_STRING) )
then
486 if( ldclass <> rdclass )
then
491 return rtlStrAssign(
l, r, (options
and AST_OPOPT_ISINI) <> 0 )
495 if( (options
and AST_OPOPT_ISINI) <> 0 )
then
501 elseif( (ldtype = FB_DATATYPE_STRUCT)
or _
502 (rdtype = FB_DATATYPE_STRUCT) )
then
504 if(
hCheckUDTOps(
l, ldclass, r, rdclass, FALSE ) = FALSE )
then
509 if( astIsTYPEINI( r ) )
then
511 dim as ASTNODE
ptr t =
l
512 if(
l->
class = AST_NODECLASS_CONV )
then
513 if(
l->
cast.doconv = FALSE )
then
524 if( t->
class = AST_NODECLASS_VAR )
then
533 if( astIsCALL( r ) )
then
539 assert( symbProcReturnsByref( r->sym ) = FALSE )
542 ldfull = symbGetProcRealType( r->sym )
543 ldtype = typeGet( ldfull )
544 lsubtype = symbGetProcRealSubtype( r->sym )
545 ldclass = typeGetClass( ldtype )
559 return astNewMEM( AST_OP_MEMMOVE,
l, r, symbGetLen(
l->subtype ) )
563 elseif( (ldtype = FB_DATATYPE_WCHAR)
or _
564 (rdtype = FB_DATATYPE_WCHAR) )
then
568 if( ldtype <> rdtype )
then
569 dim as integer is_zstr
581 ldclass = typeGetClass( ldfull )
582 rdclass = typeGetClass( rdfull )
583 ldtype = typeGet( ldfull )
584 rdtype = typeGet( rdfull )
588 if( (options
and AST_OPOPT_ISINI) <> 0 )
then
593 elseif( (ldtype = FB_DATATYPE_CHAR)
or _
594 (rdtype = FB_DATATYPE_CHAR) )
then
597 if( ldtype = rdtype )
then
606 ldclass = typeGetClass( ldfull )
607 rdclass = typeGetClass( rdfull )
608 ldtype = typeGet( ldfull )
609 rdtype = typeGet( rdfull )
612 elseif( (ldtype = FB_DATATYPE_ENUM)
or _
613 (rdtype = FB_DATATYPE_ENUM) )
then
618 if( (options
and AST_OPOPT_DONTCHKPTR) = 0 )
then
625 if( ldtype <> rdtype )
then
627 if( rdclass <> FB_DATACLASS_STRING )
then
629 if( astIsCONST( r ) )
then
631 iif( options
and AST_OPOPT_DONTCHKPTR, AST_CONVOPT_DONTCHKPTR, 0 ) )
639 dim as integer doconv =
TRUE
640 if( env.clopt.backend = FB_BACKEND_GAS )
then
641 if( (ldclass = FB_DATACLASS_FPOINT)
or (rdclass = FB_DATACLASS_FPOINT) )
then
642 if( ldtype <> FB_DATATYPE_ULONGINT )
then
643 doconv = irGetOption( IR_OPT_FPUCONV )
650 iif( options
and AST_OPOPT_DONTCHKPTR, AST_CONVOPT_DONTCHKPTR, 0 ) )
659 n =
astNewNode( AST_NODECLASS_ASSIGN, ldfull, lsubtype )
669 dim as ASTNODE
ptr l =
any, r =
any
670 dim as IRVREG
ptr vs =
any, vr =
any
674 if( (
l = NULL)
or (r = NULL) )
then
678 if( r->
class = AST_NODECLASS_CONV )
then
679 astUpdateCONVFD2FS( r,
l->dtype, FALSE )
685 if( ast.doemit )
then
686 irEmitSTORE( vr, vs )