31 byval expr
as ASTNODE
ptr, _
32 byval no_fake
as integer =
FALSE _
35 dim as integer dtype =
any
36 dim as FBSYMBOL
ptr subtype =
any
38 dtype = symbGetFullType(
ctx.
sym )
39 subtype = symbGetSubtype(
ctx.
sym )
41 if( (
ctx.
options and FB_INIOPT_DODEREF) <> 0 )
then
42 dtype = typeDeref( dtype )
48 if( expr = NULL )
then
57 errReport( FB_ERRMSG_INVALIDDATATYPES, TRUE )
73 byval no_fake
as integer =
FALSE _
76 dim as ASTNODE
ptr expr =
any
77 dim as FBSYMBOL
ptr oldsym =
any
78 dim as integer old_dtype =
any
84 oldsym = parser.ctxsym
85 old_dtype = parser.ctx_dtype
86 parser.ctxsym = symbGetSubType(
ctx.
sym )
87 parser.ctx_dtype = symbGetType(
ctx.
sym )
93 if( expr = NULL )
then
99 dim as integer dtype = symbGetType(
ctx.
sym )
100 if( (
ctx.
options and FB_INIOPT_DODEREF) <> 0 )
then
101 dtype = typeDeref( dtype )
110 parser.ctxsym = oldsym
111 parser.ctx_dtype = old_dtype
120 byval no_fake
as integer =
FALSE _
123 dim as integer dimensions =
any, elm_cnt =
any
124 dim as longint elements =
any
125 dim as integer isarray =
any, dtype =
any
126 dim as FBVARDIM
ptr old_dim =
any
127 dim as FBSYMBOL
ptr subtype =
any
128 static as FBARRAYDIM dTB(0
to FB_MAXARRAYDIMS - 1)
134 assert( symbIsVar(
ctx.
sym )
or symbIsField(
ctx.
sym ) )
168 dimensions = symbGetArrayDimensions(
ctx.
sym )
183 FB_ERRMSG_TOOMANYEXPRESSIONS, _
184 FB_ERRMSG_EXPECTEDARRAY ) )
217 if(
ctx.
dim_->upper = FB_ARRAYDIM_UNKNOWN )
then
227 dtype = symbGetType(
ctx.
sym )
228 subtype = symbGetSubtype(
ctx.
sym )
229 if( (
ctx.
options and FB_INIOPT_DODEREF) <> 0 )
then
230 dtype = typeDeref( dtype )
242 select case as const dtype
243 case FB_DATATYPE_STRUCT
256 if( elements = -1 )
then
270 ((
ctx.
sym->attrib
and (FB_SYMBATTRIB_SHARED
or FB_SYMBATTRIB_STATIC)) = 0), _
282 if( elm_cnt >= elements )
then
297 if( elements > 0 )
then
303 dim as FBSYMBOL
ptr ctor = NULL
304 if( (
ctx.
options and FB_INIOPT_ISOBJ) <> 0 )
then
306 if( ctor = NULL )
then
307 errReport( FB_ERRMSG_NODEFAULTCTORDEFINED )
311 errReport( FB_ERRMSG_NOACCESSTODEFAULTCTOR )
316 if( ctor <> NULL )
then
319 dim as longint pad_lgt =
any
321 select case as const dtype
322 case FB_DATATYPE_FIXSTR, FB_DATATYPE_CHAR, FB_DATATYPE_WCHAR
323 pad_lgt = symbGetLen(
ctx.
sym )
331 astTypeIniGetOfs(
ctx.
tree ) += pad_lgt
361 static as integer rec_cnt
363 dim as integer elm_cnt =
any, dtype =
any
364 dim as longint lgt =
any, baseofs =
any, pad_lgt =
any
365 dim as FBSYMBOL
ptr fld =
any, first =
any, subtype =
any
366 dim as FBSYMBOL
ptr oldsubtype =
any
367 dim as integer olddtype =
any
374 dtype = symbGetType(
ctx.
sym )
375 subtype = symbGetSubtype(
ctx.
sym )
376 if( (
ctx.
options and FB_INIOPT_DODEREF) <> 0 )
then
377 dtype = typeDeref( dtype )
381 if( (
ctx.
options and FB_INIOPT_ISOBJ) <> 0 )
then
382 dim as ASTNODE
ptr expr =
any
386 oldsubtype = parser.ctxsym
387 olddtype = parser.ctx_dtype
388 parser.ctx_dtype = dtype
389 parser.ctxsym = subtype
395 parser.ctx_dtype = olddtype
396 parser.ctxsym = oldsubtype
398 if( expr = NULL )
then
399 errReport( FB_ERRMSG_EXPECTEDEXPRESSION )
410 if( symbGetClass(
ctx.
sym ) = FB_SYMBCLASS_PARAM )
then
411 if( symbGetParamMode(
ctx.
sym ) = FB_PARAMMODE_BYREF )
then
412 if( (astGetDataType( expr ) = dtype)
and _
413 (astGetSubtype( expr ) = subtype) )
then
420 dim as integer is_ctorcall =
any
422 if( expr = NULL )
then
427 if( is_ctorcall )
then
437 dim as integer parenth = TRUE, comma =
FALSE
441 if( rec_cnt <= 1 )
then
461 baseofs = astTypeIniGetOfs(
ctx.
tree )
473 if( fld = NULL )
then
474 errReport( FB_ERRMSG_TOOMANYEXPRESSIONS )
482 pad_lgt = fld->ofs - lgt
483 if( pad_lgt > 0 )
then
489 astTypeIniGetOfs(
ctx.
tree ) = baseofs + fld->ofs
492 errReport( FB_ERRMSG_ILLEGALMEMBERACCESS )
506 errReport( FB_ERRMSG_INVALIDDATATYPES, TRUE )
512 dim as integer is_ctorcall =
any
518 if( expr = NULL )
then
535 if( is_ctorcall )
then
543 lgt += symbGetLen( fld ) * symbGetArrayElements( fld )
549 if( rec_cnt > 1 )
then
554 if( fld = NULL )
then
583 dim as longint sym_len =
symbCalcLen( dtype, subtype )
584 pad_lgt = sym_len - lgt
585 if( pad_lgt > 0 )
then
588 astTypeIniGetOfs(
ctx.
tree ) = baseofs + sym_len
598 byval sym as FBSYMBOL
ptr, _
602 dim as integer is_local =
any, dtype =
any, ok =
any
603 dim as FBSYMBOL
ptr subtype =
any
608 if( symbIsVar(
sym ) )
then
610 if( symbGetIsDynamic(
sym ) )
then
611 errReport( FB_ERRMSG_CANTINITDYNAMICARRAYS, TRUE )
616 if( symbIsCommon(
sym ) )
then
617 errReport( FB_ERRMSG_CANTINITDYNAMICARRAYS, TRUE )
621 is_local = symbIsLocal(
sym )
628 dtype = symbGetType(
sym )
629 subtype = symbGetSubtype(
sym )
630 if( (
options and FB_INIOPT_DODEREF) <> 0 )
then
631 dtype = typeDeref( dtype )
649 if( symbIsVar(
ctx.
sym )
or symbIsField(
ctx.
sym ) )
then
653 if( dtype = FB_DATATYPE_STRUCT )
then
662 if( symbIsVar(
ctx.
sym ) )
then
663 symbSetIsInitialized(
ctx.
sym )
666 function =
iif( ok,
ctx.
tree, NULL )