15 listInit( @parser.ovlarglist, 32*4,
len( FB_CALL_ARG ), LIST_FLAGS_NOCLEAR )
30 byval proc as FBSYMBOL
ptr, _
31 byval param
as FBSYMBOL
ptr, _
32 byval argnum
as integer, _
33 byref expr
as ASTNODE
ptr, _
34 byref amode
as integer, _
35 byref have_eq_outside_parens
as integer, _
36 byval options
as FB_PARSEROPT _
39 dim as integer pmode =
any, old_dtype =
any
40 dim as FBSYMBOL
ptr oldsym =
any
44 pmode = symbGetParamMode( param )
51 amode = FB_PARAMMODE_BYVAL
54 oldsym = parser.ctxsym
55 old_dtype = parser.ctx_dtype
56 parser.ctxsym = symbGetSubType( param )
57 parser.ctx_dtype = symbGetType( param )
58 parser.have_eq_outside_parens = FALSE
63 have_eq_outside_parens
or= parser.have_eq_outside_parens
66 fbSetPrntOptional( FALSE )
68 if( expr = NULL )
then
69 if( (options
and FB_PARSEROPT_ISFUNC) <> 0 )
then
73 if( (argnum = 0)
and (amode = INVALID) )
then
75 if(
hMatch( FB_TK_BYVAL ) )
then
76 amode = FB_PARAMMODE_BYVAL
83 parser.ctxsym = oldsym
84 parser.ctx_dtype = old_dtype
86 if( expr = NULL )
then
88 if( symbGetIsOptional( param ) = FALSE )
then
89 if( pmode = FB_PARAMMODE_VARARG )
then
94 expr =
astNewCONSTz( symbGetType( param ), symbGetSubType( param ) )
98 if( pmode = FB_PARAMMODE_BYDESC )
then
101 if( amode <> INVALID )
then
106 amode = FB_PARAMMODE_BYDESC
113 if( amode <> INVALID )
then
114 if( amode <> pmode )
then
115 if( pmode <> FB_PARAMMODE_VARARG )
then
118 if( amode <> FB_PARAMMODE_BYVAL )
then
119 if( amode <> pmode )
then
138 byval argnum
as integer, _
139 byval arg
as FB_CALL_ARG
ptr, _
140 byref have_eq_outside_parens
as integer, _
141 byval options
as FB_PARSEROPT _
144 dim as FBSYMBOL
ptr oldsym =
any
145 dim as integer old_dtype =
any
151 if(
hMatch( FB_TK_BYVAL ) )
then
152 arg->mode = FB_PARAMMODE_BYVAL
155 oldsym = parser.ctxsym
156 old_dtype = parser.ctx_dtype
158 parser.ctx_dtype = FB_DATATYPE_INVALID
159 parser.have_eq_outside_parens = FALSE
163 if( arg->expr = NULL )
then
165 if( (options
and FB_PARSEROPT_ISFUNC) <> 0 )
then
169 if( (argnum = 0)
and (arg->mode = INVALID) )
then
171 if(
hMatch( FB_TK_BYVAL ) )
then
172 arg->mode = FB_PARAMMODE_BYVAL
179 parser.ctxsym = oldsym
180 parser.ctx_dtype = old_dtype
181 have_eq_outside_parens
or= parser.have_eq_outside_parens
184 if( arg->expr <> NULL )
then
188 if( arg->mode <> INVALID )
then
193 arg->mode = FB_PARAMMODE_BYDESC
201 byval args
as integer, _
202 byval have_eq_outside_parens
as integer, _
203 byval proc as FBSYMBOL
ptr _
206 dim as integer warn =
any
221 warn = symbProcReturnsByref(
proc )
223 if( warn = FALSE )
then
226 if( symbGetProcIsOverloaded(
proc ) )
then
229 if(
proc = NULL )
then
233 warn = symbProcReturnsByref(
proc )
239 warn
and= have_eq_outside_parens
249 byval proc as FBSYMBOL
ptr, _
250 byval thisexpr
as ASTNODE
ptr, _
251 byval options
as FB_PARSEROPT _
257 if( options
and FB_PARSEROPT_EXPLICITBASE )
then
259 if( symbIsAbstract(
proc ) )
then
276 byval proc as FBSYMBOL
ptr, _
277 byval arg_list
as FB_CALL_ARG_LIST
ptr, _
278 byval options
as FB_PARSEROPT _
281 dim as integer i =
any, params =
any, args =
any, have_eq_outside_parens =
any
282 dim as ASTNODE
ptr procexpr =
any
283 dim as FBSYMBOL
ptr param =
any, ovlproc =
any
284 dim as FB_CALL_ARG
ptr arg =
any, nxt =
any
285 dim as FB_ERRMSG err_num =
any
288 have_eq_outside_parens = FALSE
290 params = symGetProcOvlMaxParams(
proc )
292 args = arg_list->args
293 if( (options
and FB_PARSEROPT_HASINSTPTR) <> 0 )
then
297 if( (options
and FB_PARSEROPT_OPTONLY) = 0 )
then
298 dim as integer init_args = args
302 if( args > params )
then
305 if( (options
and FB_PARSEROPT_ISFUNC) <> 0 )
then
318 hOvlProcArg( args - init_args, arg, have_eq_outside_parens, options )
323 if( arg->expr <> NULL )
then
341 dim as FB_SYMBLOOKUPOPT lkup_options = FB_SYMBLOOKUPOPT_NONE
342 if( symbIsProperty(
proc ) )
then
343 if( (options
and FB_PARSEROPT_ISPROPGET) <> 0 )
then
344 lkup_options = FB_SYMBLOOKUPOPT_PROPGET
350 iif( (options
and FB_PARSEROPT_HASINSTPTR) <> 0, _
351 arg_list->head->
next, _
356 if( ovlproc = NULL )
then
359 if( err_num = FB_ERRMSG_OK )
then
360 err_num = FB_ERRMSG_NOMATCHINGPROC
373 FB_ERRMSG_NOACCESSTOCTOR, _
374 FB_ERRMSG_ILLEGALMEMBERACCESS ), _
381 if( symbIsMethod(
proc ) )
then
383 if( (options
and FB_PARSEROPT_HASINSTPTR) = 0 )
then
386 if( (
base_parent <> NULL)
or (symbIsMethod( parser.currproc ) = FALSE) )
then
387 errReport( FB_ERRMSG_MEMBERISNTSTATIC, TRUE )
396 symbGetProcHeadParam( parser.currproc ) ) )
406 if( (options
and FB_PARSEROPT_HASINSTPTR) <> 0 )
then
408 arg_list->head = arg->
next
410 symbFreeOvlCallArg( @parser.ovlarglist, arg )
418 param = symbGetProcHeadParam(
proc )
423 if(
astNewARG( procexpr, arg->expr, , arg->mode ) = NULL )
then
430 symbFreeOvlCallArg( @parser.ovlarglist, arg )
438 params = symbGetProcParams(
proc )
439 do while( args < params )
456 byval proc as FBSYMBOL
ptr, _
457 byval ptrexpr
as ASTNODE
ptr, _
458 byval arg_list
as FB_CALL_ARG_LIST
ptr, _
459 byval options
as FB_PARSEROPT _
462 dim as integer args =
any, params =
any, mode =
any, have_eq_outside_parens =
any
463 dim as FBSYMBOL
ptr param =
any
464 dim as ASTNODE
ptr procexpr =
any, expr =
any
465 dim as FB_CALL_ARG
ptr arg =
any
468 if( symbGetProcIsOverloaded(
proc ) )
then
470 if( symbGetProcOvlNext(
proc ) <> NULL )
then
476 have_eq_outside_parens = FALSE
481 FB_ERRMSG_NOACCESSTOCTOR, _
482 FB_ERRMSG_ILLEGALMEMBERACCESS ), _
489 if( symbIsMethod(
proc ) )
then
491 if( (options
and FB_PARSEROPT_HASINSTPTR) = 0 )
then
494 if( (
base_parent <> NULL)
or (symbIsMethod( parser.currproc ) = FALSE) )
then
495 errReport( FB_ERRMSG_MEMBERISNTSTATIC, TRUE )
504 symbGetProcHeadParam( parser.currproc ) ) )
511 assert( ptrexpr = NULL )
516 if( (options
and FB_PARSEROPT_HASINSTPTR) <> 0 )
then
518 arg_list->head = arg->
next
520 symbFreeOvlCallArg( @parser.ovlarglist, arg )
526 params = symbGetProcParams(
proc )
528 param = symbGetProcHeadParam(
proc )
532 do while( arg <> NULL )
533 dim as FB_CALL_ARG
ptr nxt = arg->
next
535 if(
astNewARG( procexpr, arg->expr, , arg->mode ) = NULL )
then
539 symbFreeOvlCallArg( @parser.ovlarglist, arg )
550 if( params = 0 )
then
552 if( (options
and FB_PARSEROPT_ISFUNC) = 0 )
then
570 if( (options
and FB_PARSEROPT_OPTONLY) = 0 )
then
573 if( args >= params )
then
574 if( param->param.mode <> FB_PARAMMODE_VARARG )
then
577 if( (options
and FB_PARSEROPT_ISFUNC) <> 0 )
then
588 if(
hProcArg(
proc, param, args, expr, mode, have_eq_outside_parens, options ) = FALSE )
then
593 if(
astNewARG( procexpr, expr, , mode ) = NULL )
then
595 if( (options
and FB_PARSEROPT_ISFUNC) <> 0 )
then
609 if( args < params )
then
614 loop while(
hMatch( CHAR_COMMA ) )
620 do while( args < params )
622 if( param->param.mode = FB_PARAMMODE_VARARG )
then
627 if( symbGetIsOptional( param ) = FALSE )
then
635 if(
astNewARG( procexpr, NULL ) = NULL )
then