19 byval lhs
as FBSYMBOL
ptr, _
20 byval rhs
as integer _
29 byval lhs
as FBSYMBOL
ptr, _
30 byval rhs
as ASTNODE
ptr _
38 assert( symbGetIsWstring( sym ) )
44 byval sym
as FBSYMBOL
ptr, _
45 byval expr
as ASTNODE
ptr, _
46 byval options
as integer _
49 dim as ASTNODE
ptr t =
any
51 assert( symbGetIsWstring( sym ) )
59 assert( astGetDataType( expr ) = FB_DATATYPE_WCHAR )
77 byval lhs
as FBSYMBOL
ptr, _
78 byval rhs
as integer _
81 dim as AST_OPOPT options =
any
82 dim as AST_OP op =
any
84 options = AST_OPOPT_DEFAULT
85 if( typeIsPtr( symbGetType( lhs ) ) )
then
86 options
or= AST_OPOPT_LPTRARITH
112 byval s
as FBSYMBOL
ptr, _
113 byval check_access
as integer _
120 if( symbGetArrayDimensions( s ) <> 0 )
then
124 select case symbGetType( s )
126 case FB_DATATYPE_STRING
130 case typeAddrOf( FB_DATATYPE_WCHAR )
131 assert( symbGetIsWstring( s ) )
139 if( check_access )
then
153 byval sym
as FBSYMBOL
ptr, _
154 byval fld
as FBSYMBOL
ptr, _
155 byval ofs
as longint _
158 dim as ASTNODE
ptr expr =
any
161 ofs += symbGetOfs( fld )
164 if( symbIsParamByRef( sym )
or symbIsImport( sym ) )
then
166 astNewVAR( sym, , typeAddrOf( symbGetFullType( sym ) ), _
167 symbGetSubtype( sym ) ), _
168 symbGetFullType( fld ), symbGetSubtype( fld ), ofs )
170 expr =
astNewVAR( sym, ofs, symbGetFullType( fld ), symbGetSubtype( fld ) )
176 if( symbIsParamByRef( sym )
or symbIsImport( sym ) )
then
178 astNewVAR( sym, , typeAddrOf( symbGetFullType( sym ) ), _
179 symbGetSubtype( sym ) ), _
194 if( symbIsStatic( sym ) )
then
198 assert( symbIsShared( sym ) = FALSE )
199 assert( symbIsTemp( sym ) )
212 byval tree
as ASTNODE
ptr, _
213 byval cnt
as FBSYMBOL
ptr, _
214 byval label
as FBSYMBOL
ptr, _
215 byval inivalue
as integer, _
216 byval flush_label
as integer _
230 byval tree
as ASTNODE
ptr, _
231 byval cnt
as FBSYMBOL
ptr, _
232 byval label
as FBSYMBOL
ptr, _
233 byval endvalue
as ASTNODE
ptr _
256 byval proc as FBSYMBOL
ptr, _
257 byval thisexpr
as ASTNODE
ptr _
260 dim as ASTNODE
ptr p =
any
261 dim as integer vtableindex =
any
263 if( symbIsVirtual(
proc ) )
then
265 assert( vtableindex > 0 )
286 p =
astNewCONV( typeMultAddrOf( FB_DATATYPE_VOID, 3 ), NULL, p, AST_CONVOPT_DONTCHKPTR )
291 NULL, AST_OPOPT_DEFAULT
or AST_OPOPT_DOPTRARITH )
302 if( env.clopt.extraerrchk )
then
303 if( symbIsAbstract(
proc ) )
then
317 byval proc as FBSYMBOL
ptr, _
318 byval arg1
as ASTNODE
ptr, _
319 byval arg2
as ASTNODE
ptr, _
320 byval arg3
as ASTNODE
ptr _
323 dim as ASTNODE
ptr p =
any, ptrexpr =
any
327 if( symbIsVirtual(
proc ) )
then
329 assert( symbIsMethod(
proc ) )
330 assert( astGetDataType( arg1 ) = FB_DATATYPE_STRUCT )
331 assert( astGetSubtype( arg1 ) = symbGetNamespace(
proc ) )
366 byval sym
as FBSYMBOL
ptr, _
367 byval thisexpr
as ASTNODE
ptr _
370 dim as FBSYMBOL
ptr ctor =
any
371 dim as ASTNODE
ptr proc =
any
372 dim as integer params =
any
375 if( ctor = NULL )
then
384 params = symbGetProcParams( ctor ) - 1
385 do while( params > 0 )
396 byval sym
as FBSYMBOL
ptr, _
397 byval thisexpr
as ASTNODE
ptr, _
398 byval ignore_virtual
as integer _
401 dim as FBSYMBOL
ptr dtor =
any
402 dim as ASTNODE
ptr callexpr =
any
406 if( ignore_virtual )
then
418 assert( symbIsStruct( subtype ) )
419 function =
astNewCONSTi( 0, typeAddrOf( FB_DATATYPE_STRUCT ), subtype )
424 byval procexpr
as ASTNODE
ptr, _
425 byval thisexpr
as ASTNODE
ptr _
430 assert( astIsCALL( procexpr ) )
441 byval n
as ASTNODE
ptr _
444 dim as FBSYMBOL
ptr sym =
any
445 dim as ASTNODE
ptr procexpr =
any
447 assert( astIsCALLCTOR( n ) )
449 sym = astGetSymbol( n->r )
456 assert( symbGetType( sym ) = FB_DATATYPE_STRUCT )
477 byval subtype
as FBSYMBOL
ptr, _
478 byval expr
as ASTNODE
ptr, _
479 byval arg_mode
as FB_PARAMMODE, _
480 byref is_ctorcall
as integer _
483 dim as integer err_num =
any
484 dim as FBSYMBOL
ptr proc =
any
487 if(
proc = NULL )
then
490 if( err_num <> FB_ERRMSG_OK )
then
514 dim as integer params = symbGetProcParams(
proc ) - 2
515 do while( params > 0 )
528 byval sym
as FBSYMBOL
ptr, _
529 byval expr
as ASTNODE
ptr, _
530 byval arg_mode
as FB_PARAMMODE, _
531 byref is_ctorcall
as integer _
534 dim as FBSYMBOL
ptr subtype =
any
536 subtype = symbGetSubType( sym )
539 if( astIsCALLCTOR( expr ) )
then
540 if( symbGetSubtype( expr ) = subtype )
then
557 symbSetIsAccessed(
proc )
564 byval proc as FBSYMBOL
ptr, _
565 byval res
as FBSYMBOL
ptr _
570 function =
astNewDEREF(
astNewVAR( res, 0, typeAddrOf( FB_DATATYPE_STRUCT ), symbGetSubtype( res ) ) )
584 byval sym
as FBSYMBOL
ptr, _
585 byval fld
as FBSYMBOL
ptr, _
586 byval idxexpr
as ASTNODE
ptr _
589 dim as ASTNODE
ptr expr =
any
590 dim as integer dtype =
any
591 dim as FBSYMBOL
ptr subtype =
any
592 dim as longint ofs =
any
594 dtype = symbGetFullType( sym )
595 subtype = symbGetSubtype( sym )
598 expr =
astNewVAR( sym, 0, typeAddrOf( dtype ), subtype )
600 if( fld <> NULL )
then
601 dtype = symbGetFullType( fld )
602 subtype = symbGetSubtype( fld )
606 ofs = symbGetOfs( fld )
612 if( idxexpr <> NULL )
then
623 if( fld <> NULL )
then
632 byval sym
as FBSYMBOL
ptr, _
633 byval fld
as FBSYMBOL
ptr, _
634 byval ofs
as longint _
637 dim as ASTNODE
ptr expr =
any
638 dim as integer dtype =
any
639 dim as FBSYMBOL
ptr subtype =
any
641 dtype = symbGetFullType( sym )
642 subtype = symbGetSubtype( sym )
646 expr =
astNewVAR( sym, 0, typeAddrOf( dtype ), subtype )
648 if( fld <> NULL )
then
649 dtype = symbGetFullType( fld )
650 subtype = symbGetSubtype( fld )
659 if( fld <> NULL )
then
673 byval sym
as FBSYMBOL
ptr _
676 dim as ASTNODE
ptr tree
678 tree =
astTypeIniBegin( symbGetFullType( sym ), symbGetSubtype( sym ), TRUE )
691 byval cnt
as integer, _
692 byval expr
as ASTNODE
ptr, _
693 byval dtype
as integer, _
694 byval subtype
as FBSYMBOL
ptr _
698 if( typeIsPtr( dtype ) = FALSE )
then
699 if( symb.globOpOvlTb(AST_OP_DEREF).head = NULL )
then
700 errReport( FB_ERRMSG_EXPECTEDPOINTER, TRUE )
705 dim as FBSYMBOL
ptr proc =
any
706 dim as FB_ERRMSG err_num =
any
709 if(
proc <> NULL )
then
712 if( expr = NULL )
then
716 dtype = astGetFullType( expr )
717 subtype = astGetSubType( expr )
719 errReport( FB_ERRMSG_EXPECTEDPOINTER, TRUE )
723 dtype = typeDeref( dtype )
726 select case typeGet( dtype )
727 case FB_DATATYPE_VOID, FB_DATATYPE_FWDREF
728 errReport( FB_ERRMSG_INCOMPLETETYPE, TRUE )
730 dtype = FB_DATATYPE_BYTE
733 case FB_DATATYPE_FUNCTION
737 errReport( FB_ERRMSG_TYPEMISMATCH, TRUE )
738 dtype = FB_DATATYPE_BYTE
743 if( env.clopt.extraerrchk )
then
764 byval desc
as FBSYMBOL
ptr, _
765 byval array
as FBSYMBOL
ptr, _
766 byval array_expr
as ASTNODE
ptr _
769 dim as ASTNODE
ptr tree =
any
770 dim as integer dtype =
any, dims =
any
771 dim as FBSYMBOL
ptr elm =
any, dimtb =
any, subtype =
any
774 if( symbIsCommon( array )
or symbIsExtern( array ) )
then
779 tree =
astTypeIniBegin( symbGetFullType( desc ), symbGetSubtype( desc ), TRUE )
781 dtype = symbGetFullType( array )
782 subtype = symbGetSubType( array )
783 dims = symbGetArrayDimensions( array )
786 elm = symbGetUDTSymbTbHead( symbGetSubtype( desc ) )
788 if( array_expr = NULL )
then
789 if( symbGetIsDynamic( array ) )
then
790 array_expr =
astNewCONSTi( 0, typeAddrOf( dtype ), subtype )
806 elm = symbGetNext( elm )
811 elm = symbGetNext( elm )
815 astNewCONSTi( symbGetLen( array ) * symbGetArrayElements( array ) ), _
818 elm = symbGetNext( elm )
823 elm = symbGetNext( elm )
830 elm = symbGetNext( elm )
833 dimtb = symbGetUDTSymbTbHead( symbGetSubtype( elm ) )
838 if( symbGetIsDynamic( array ) = FALSE )
then
841 dim as FBVARDIM
ptr d
843 d = symbGetArrayFirstDim( array )
844 do while( d <> NULL )
852 elm = symbGetNext( elm )
857 elm = symbGetNext( elm )
872 dims = FB_MAXARRAYDIMS
887 symbSetIsInitialized( desc )
895 byval arrayexpr
as ASTNODE
ptr, _
896 byval dimexpr
as ASTNODE
ptr, _
897 byval is_lbound
as integer _
900 dim as FBSYMBOL
ptr array =
any
901 dim as FBVARDIM
ptr d =
any
902 dim as integer dimension =
any
903 dim as longint bound =
any
908 select case( arrayexpr->
class )
909 case AST_NODECLASS_VAR, AST_NODECLASS_FIELD
915 array = arrayexpr->sym
916 if( array = NULL )
then
921 if( symbIsDynamic( array )
or symbIsParamBydesc( array ) )
then
926 if( astIsCONST( dimexpr ) = FALSE )
then
931 assert( astGetDataType( dimexpr ) = FB_DATATYPE_INTEGER )
932 dimension = astConstGetInt( dimexpr )
935 if( dimension >= 1 )
then
936 d = symbGetArrayFirstDim( array )
937 while( (d <> NULL)
and (dimension > 1) )
953 if( d->upper = FB_ARRAYDIM_UNKNOWN )
then
963 if( dimension = 0 )
then
964 bound =
iif( is_lbound, 1, symbGetArrayDimensions( array ) )
966 bound =
iif( is_lbound, 0, -1 )
975 byval arrayexpr
as ASTNODE
ptr, _
976 byval dimexpr
as ASTNODE
ptr, _
977 byval tk
as integer _
980 dim as ASTNODE
ptr expr =
any
986 dimexpr =
astNewCONV( FB_DATATYPE_INTEGER, NULL, dimexpr )
990 expr =
hConstBound( arrayexpr, dimexpr, (tk = FB_TK_LBOUND) )
992 if( expr = NULL )
then
996 expr =
rtlArrayBound( arrayexpr, dimexpr, (tk = FB_TK_LBOUND) )
1008 dim as ASTNODE
ptr expr =
any