21 if( astGetSymbol( arg ) <> NULL )
then
25 function = FB_PARAMMODE_BYDESC
33 dim as FBSYMBOL
ptr res =
any, subtype =
any
34 dim as ASTNODE
ptr rhs =
any, expr =
any
35 dim as integer has_ctor =
any, has_defctor =
any
52 if( symbGetProcStatAssignUsed( parser.currproc ) )
then
53 if( has_defctor )
then
54 errReport( FB_ERRMSG_RETURNMIXEDWITHASSIGN )
58 symbSetProcStatReturnUsed( parser.currproc )
60 if( symbGetProcStatReturnUsed( parser.currproc ) )
then
61 if( has_defctor )
then
62 errReport( FB_ERRMSG_ASSIGNMIXEDWITHRETURN )
66 symbSetProcStatAssignUsed( parser.currproc )
71 parser.ctxsym = symbGetSubType( parser.currproc )
72 parser.ctx_dtype = symbGetType( parser.currproc )
83 if( symbProcReturnsByref( parser.currproc )
and (
not hMatch( FB_TK_BYVAL )) )
then
90 errReport( FB_ERRMSG_INVALIDREFERENCETOLOCAL )
94 if( (symbGetType( parser.currproc ) = FB_DATATYPE_STRING)
and _
111 parser.ctx_dtype = FB_DATATYPE_INVALID
113 if( rhs = NULL )
then
114 errReport( FB_ERRMSG_EXPECTEDEXPRESSION )
121 symbSetIsAccessed( res )
124 if( is_return
and has_ctor )
then
125 dim as integer is_ctorcall =
any
127 if( rhs = NULL )
then
131 if( is_ctorcall )
then
139 if( expr = NULL )
then
151 byval proc as FBSYMBOL
ptr, _
152 byval thisexpr
as ASTNODE
ptr, _
153 byval arg_list
as FB_CALL_ARG_LIST
ptr, _
154 byval options
as FB_PARSEROPT
ptr _
158 if( thisexpr = NULL )
then
170 dim as FBSYMBOL
ptr parent = symbGetParent(
proc )
171 if( astGetSubtype( thisexpr ) <> parent )
then
172 thisexpr =
astNewCONV( symbGetType( parent ), parent, thisexpr )
176 arg->mode = hGetInstPtrMode( thisexpr )
178 *options
or= FB_PARSEROPT_HASINSTPTR
186 byval sym
as FBSYMBOL
ptr, _
187 byval ptrexpr
as ASTNODE
ptr, _
188 byval thisexpr
as ASTNODE
ptr, _
189 byval checkprnts
as integer, _
190 byval options
as FB_PARSEROPT _
193 dim as integer dtype =
any, is_propset = FALSE
194 dim as ASTNODE
ptr procexpr =
any
195 dim as FB_CALL_ARG_LIST arg_list = ( 0, NULL, NULL )
202 if( symbIsProperty( sym ) )
then
204 dim as integer is_indexed = FALSE
214 if( expr = NULL )
then
215 errReport( FB_ERRMSG_EXPECTEDEXPRESSION )
236 if( is_indexed )
then
237 if( symbGetUDTHasIdxSetProp( symbGetParent( sym ) ) = FALSE )
then
238 errReport( FB_ERRMSG_PROPERTYHASNOIDXSETMETHOD, TRUE )
242 if( symbGetUDTHasSetProp( symbGetParent( sym ) ) = FALSE )
then
243 errReport( FB_ERRMSG_PROPERTYHASNOSETMETHOD )
254 options
or= FB_PARSEROPT_ISPROPGET
256 if( is_indexed )
then
257 if( symbGetUDTHasIdxGetProp( symbGetParent( sym ) ) = FALSE )
then
258 errReport( FB_ERRMSG_PROPERTYHASNOIDXGETMETHOD, TRUE )
262 if( symbGetUDTHasGetProp( symbGetParent( sym ) ) = FALSE )
then
263 errReport( FB_ERRMSG_PROPERTYHASNOGETMETHOD )
275 if( checkprnts = TRUE )
then
277 if( symbGetProcParams( sym ) = 0 )
then
282 elseif( ptrexpr <> NULL )
then
288 if( checkprnts )
then
290 if(
hMatch( CHAR_LPRNT ) = FALSE )
then
296 fbSetPrntOptional(
not checkprnts )
300 if( procexpr = NULL )
then
306 if( (checkprnts)
or (parser.prntcnt > 0) )
then
310 if(
hMatch( CHAR_RPRNT ) = FALSE )
then
314 elseif( parser.prntcnt > 0 )
then
316 do while( parser.prntcnt > 0 )
323 fbSetPrntOptional( FALSE )
325 if( is_propset = FALSE )
then
333 if( procexpr = NULL )
then
339 if( astIsCALL( procexpr ) = FALSE )
then
347 case FB_TK_STMTSEP, FB_TK_EOL, FB_TK_EOF, _
348 FB_TK_COMMENT, FB_TK_REM
361 dtype = astGetDataType( procexpr )
364 if( dtype <> FB_DATATYPE_VOID )
then
365 if( typeGetClass( dtype ) <> FB_DATACLASS_INTEGER )
then
373 select case as const dtype
374 case FB_DATATYPE_CHAR, FB_DATATYPE_WCHAR
384 sym = astGetSymbol( procexpr )
385 if( sym <> NULL )
then
386 if( symbGetIsThrowable( sym ) )
then
393 astSetType( procexpr, FB_DATATYPE_VOID, NULL )
404 byval sym
as FBSYMBOL
ptr, _
405 byval iscall
as integer, _
406 byval options
as FB_PARSEROPT = 0 _
409 dim as integer do_call =
any
423 if( do_call = FALSE )
then
425 if( symbIsProperty( sym ) )
then
429 if( symbIsProperty( parser.currproc ) )
then
430 if( symbGetProcParams( parser.currproc ) = 1 )
then
441 dim as ASTNODE
ptr expr =
any
445 if( expr <> NULL )
then
464 errReport( FB_ERRMSG_ILLEGALOUTSIDEAPROC )
479 byval sym
as FBSYMBOL
ptr, _
480 byval iscall
as integer _
483 dim as ASTNODE
ptr expr =
any
491 if( expr = NULL )
then
498 if( astIsCALL( expr ) = FALSE )
then
514 byval chain_ as FBSYMCHAIN
ptr, _
515 byval iscall
as integer _
521 dim as integer suffix = lexGetType( )
524 do while(
chain_ <> NULL )
526 dim as FBSYMBOL
ptr sym =
chain_->sym
527 dim as FBSYMBOL
ptr var_sym = NULL
530 if( suffix = FB_DATATYPE_INVALID )
then
532 dim as integer is_match = TRUE
534 if( symbIsSuffixed( sym ) )
then
537 if( symbGetClass( sym ) = FB_SYMBCLASS_VAR )
then
538 if( defdtype = FB_DATATYPE_STRING )
then
539 select case as const symbGetType( sym )
540 case FB_DATATYPE_STRING, FB_DATATYPE_FIXSTR, FB_DATATYPE_CHAR
546 is_match = (symbGetType( sym ) = defdtype)
552 select case as const symbGetClass( sym )
554 case FB_SYMBCLASS_PROC
556 if( symbGetIsRTL( sym ) )
then
557 is_match = (symbIsSuffixed( sym ) = FALSE)
565 case FB_SYMBCLASS_VAR
566 if( var_sym = NULL )
then
573 case FB_SYMBCLASS_KEYWORD
575 if( symbIsSuffixed( sym ) = FALSE )
then
583 loop while( sym <> NULL )
588 dim as integer is_match =
any
589 if( suffix = FB_DATATYPE_STRING )
then
590 select case as const symbGetType( sym )
591 case FB_DATATYPE_STRING, FB_DATATYPE_FIXSTR, FB_DATATYPE_CHAR
597 is_match = (symbGetType( sym ) = suffix)
601 select case as const symbGetClass( sym )
603 case FB_SYMBCLASS_PROC
607 case FB_SYMBCLASS_VAR
613 case FB_SYMBCLASS_KEYWORD
620 loop while( sym <> NULL )
624 if( var_sym <> NULL )
then
635 byval expr
as ASTNODE
ptr, _
636 byval iscall
as integer _
639 if( expr = NULL )
then
646 if( astIsCALL( expr ) = FALSE )
then
662 byval chain_ as FBSYMCHAIN
ptr, _
663 byval iscall
as integer, _
664 byval options
as FB_PARSEROPT = 0 _
669 do while(
chain_ <> NULL )
671 dim as FBSYMBOL
ptr sym =
chain_->sym
673 select case as const symbGetClass( sym )
675 case FB_SYMBCLASS_PROC
678 case FB_SYMBCLASS_VAR
684 case FB_SYMBCLASS_FIELD
687 case FB_SYMBCLASS_CONST
697 case FB_SYMBCLASS_KEYWORD
703 loop while( sym <> NULL )
714 case FB_TKCLASS_IDENTIFIER, FB_TKCLASS_QUIRKWD, FB_TKCLASS_OPERATOR
718 case FB_TKCLASS_KEYWORD
731 if( lexGetSymChain( ) = NULL )
then
750 dim as FBSYMCHAIN
ptr chain_ =
any
752 dim as ASTNODE
ptr expr =
any
757 if( env.clopt.lang = FB_LANG_QB )
then
762 case FB_TKCLASS_IDENTIFIER, FB_TKCLASS_QUIRKWD
768 case FB_TKCLASS_KEYWORD
776 if( fbIsModLevel( ) )
then
777 errReport( FB_ERRMSG_ILLEGALOUTSIDEAFUNCTION )
784 if( symbIsOperator( parser.currproc ) )
then
786 elseif( symbIsProperty( parser.currproc ) )
then
799 if( symbIsOperator( parser.currproc ) = FALSE )
then
800 errReport( FB_ERRMSG_ILLEGALOUTSIDEANOPERATOR )
816 if( fbIsModLevel( ) )
then
817 errReport( FB_ERRMSG_ILLEGALOUTSIDEANPROPERTY )
822 if( symbIsProperty( parser.currproc ) = FALSE )
then
823 errReport( FB_ERRMSG_ILLEGALOUTSIDEANPROPERTY )
833 case FB_TK_CONSTRUCTOR
851 if( fbLangOptIsSet( FB_LANG_OPT_CALL ) = FALSE )
then
870 errReport( FB_ERRMSG_EXPECTEDIDENTIFIER )
875 case FB_TKCLASS_OPERATOR
881 case FB_TKCLASS_DELIMITER
886 if( parser.stmt.
with.sym <> NULL )
then
890 if( expr = NULL )
then
910 dim as FBSYMBOL
ptr proc =
any, parent =
any, this_ =
any, ctor_head =
any
911 dim as ASTNODE
ptr this_expr =
any
914 if( symbIsConstructor( parser.currproc ) = FALSE )
then
915 errReport( FB_ERRMSG_ILLEGALOUTSIDEACTOR )
921 parent = symbGetNamespace( parser.currproc )
929 (parser.currproc->
proc.ext->base_initree <> NULL) )
then
930 errReport( FB_ERRMSG_CTORCHAINMUSTBEFIRST )
934 symbSetIsCtorInited( parser.currproc )
940 astBuildInstPtr( symbGetParamVar( symbGetProcHeadParam( parser.currproc ) ) ) )
945 dim as FBSYMBOL
ptr parent =
any, base_ =
any, subtype =
any
946 dim as ASTNODE
ptr initree =
any, ctorcall =
any
949 if( symbIsConstructor( parser.currproc ) = FALSE )
then
950 errReport( FB_ERRMSG_ILLEGALOUTSIDEACTOR )
957 base_ = symbGetNamespace( parser.currproc )->udt.
base
958 if( base_ = NULL )
then
974 (parser.currproc->
proc.ext->base_initree <> NULL) )
then
975 errReport( FB_ERRMSG_BASEINITMUSTBEFIRST )
984 subtype = symbGetSubtype( base_ )
993 if( astIsCALLCTOR( ctorcall ) )
then
1012 parser.currproc->
proc.ext->base_initree = initree
1017 var proc = parser.currproc
1020 if( symbIsMethod(
proc ) = FALSE )
then
1021 errReport( FB_ERRMSG_ILLEGALOUTSIDEAMETHOD )
1027 var parent = symbGetNamespace(
proc )
1030 var base_ = parent->udt.
base
1033 if( base_ = NULL )
then
1059 base_ = symbGetSubtype( base_ )->udt.
base
1062 dim as FBSYMCHAIN
chain_ = (base_, NULL, FALSE)
1063 function =
hAssignOrCall( symbGetSubType( base_ ), @
chain_, FALSE, FB_PARSEROPT_EXPLICITBASE )
1070 case FB_TKCLASS_IDENTIFIER
1071 if( fbLangOptIsSet( FB_LANG_OPT_PERIODS ) )
then
1073 if( symbIsGlobalNamespc( ) = FALSE )
then
1074 if( lexGetPeriodPos( ) > 0 )
then
1075 errReport( FB_ERRMSG_CANTINCLUDEPERIODS )
1081 errReport( FB_ERRMSG_EXPECTEDIDENTIFIER )
1089 if( lexGetType( ) <> FB_DATATYPE_INVALID )
then
1098 dim as integer check_prnt = FALSE
1104 dim as FB_CALL_ARG_LIST arg_list = ( 0, NULL, NULL )
1108 if( expr = NULL )
then
1112 dim as FB_PARAMMODE mode = FB_PARAMMODE_BYREF
1119 mode = FB_PARAMMODE_BYDESC
1124 dim as integer dtype = FB_DATATYPE_VOID
1125 select case astGetDataType( expr )
1126 case FB_DATATYPE_STRING, FB_DATATYPE_FIXSTR, _
1127 FB_DATATYPE_CHAR, FB_DATATYPE_WCHAR
1128 dtype = FB_DATATYPE_STRING
1148 if( check_prnt )
then
1158 proc =
symbAddProc(
proc, id, NULL, FB_DATATYPE_VOID, NULL, 0, env.target.fbcall, FB_SYMBOPT_NONE )
1159 if(
proc = NULL )
then
1160 errReport( FB_ERRMSG_DUPDEFINITION, TRUE )
1169 FB_PARSEROPT_OPTONLY )
1170 if( procexpr <> NULL )
then