45 dim as ASTNODE
ptr expr =
any
46 dim as integer dtype =
any, options =
any
47 dim as FBSYMBOL
ptr sym =
any, el =
any, subtype =
any
48 dim as FB_CMPSTMTSTK
ptr stk =
any
54 if(
hMatch( FB_TK_CASE ) = FALSE )
then
63 if(
hMatch( FB_TK_CONST ) )
then
76 if( outerscopenode = NULL )
then
82 if( expr = NULL )
then
89 if( astGetDataType( expr ) = FB_DATATYPE_STRUCT )
then
100 dtype = astGetFullType( expr )
101 subtype = astGetSubType( expr )
103 if( astIsVAR( expr ) )
then
107 sym = astGetSymbol( expr )
109 assert( symbIsTemp( sym ) = FALSE )
112 select case typeGet( dtype )
114 case FB_DATATYPE_FIXSTR, FB_DATATYPE_CHAR
115 dtype = FB_DATATYPE_STRING
119 if( fbLangOptIsSet( FB_LANG_OPT_SCOPE ) = FALSE )
then
120 options
or= FB_SYMBOPT_UNSCOPE
124 if( typeGet( dtype ) <> FB_DATATYPE_WCHAR )
then
135 if( typeGet( dtype ) <> FB_DATATYPE_STRING )
then
136 symbSetDontInit( sym )
139 if( options
and FB_SYMBOPT_UNSCOPE )
then
159 symbSetIsWstring( sym )
161 if( options
and FB_SYMBOPT_UNSCOPE )
then
176 FB_CMPSTMT_MASK_NOTHING )
177 stk->
select.isconst = FALSE
178 stk->
select.sym = sym
179 stk->
select.casecnt = 0
180 stk->
select.cmplabel =
symbAddLabel( NULL, FB_SYMBOPT_NONE )
181 stk->
select.endlabel = el
182 stk->
select.outerscopenode = outerscopenode
192 byval sym
as FBSYMBOL
ptr _
195 casectx.
op = AST_OP_EQ
209 if( casectx.
expr1 = NULL )
then
210 errReport( FB_ERRMSG_EXPECTEDEXPRESSION )
214 symbGetType( sym ) ) )
229 if( casectx.
expr2 = NULL )
then
230 errReport( FB_ERRMSG_EXPECTEDEXPRESSION )
243 byval sym
as FBSYMBOL
ptr, _
244 byval inilabel
as FBSYMBOL
ptr, _
245 byval nxtlabel
as FBSYMBOL
ptr, _
246 byval islast
as integer _
249 dim as ASTNODE
ptr expr =
any
252 #define NEWCASEVAR( sym ) _
253 iif( symbGetIsWstring( sym ), _
257 expr = NEWCASEVAR( sym )
262 casectx.
expr1, nxtlabel, AST_OPOPT_NONE )
265 casectx.
expr1, inilabel, AST_OPOPT_NONE )
268 expr =
astNewBOP( AST_OP_LT, expr, casectx.
expr1, nxtlabel, AST_OPOPT_NONE )
269 if( expr = NULL )
then
275 expr = NEWCASEVAR( sym )
277 expr =
astNewBOP( AST_OP_GT, expr, casectx.
expr2, nxtlabel, AST_OPOPT_NONE )
279 expr =
astNewBOP( AST_OP_LE, expr, casectx.
expr2, inilabel, AST_OPOPT_NONE )
283 if( expr = NULL )
then
294 dim as FBSYMBOL
ptr il =
any, nl =
any
295 dim as integer cnt =
any, i =
any, cntbase =
any
296 dim as FB_CMPSTMTSTK
ptr stk =
any
299 if( stk = NULL )
then
306 if( stk->
select.casecnt = -1 )
then
311 cCompSetAllowmask( stk, FB_CMPSTMT_MASK_DEFAULT )
314 if( stk->
select.isconst )
then
323 if( stk->scopenode <> NULL )
then
325 stk->scopenode = NULL
328 if( stk->
select.casecnt > 0 )
then
343 stk->
select.casecnt = -1
373 nl = stk->
select.cmplabel
378 il, nl, i = cnt-1 ) = FALSE )
then
379 errReport( FB_ERRMSG_INVALIDDATATYPES, TRUE )
397 stk->
select.casecnt += 1
402 dim as FB_CMPSTMTSTK
ptr stk =
any
405 if( stk = NULL )
then
411 if( stk->
select.casecnt = 0 )
then
416 if( stk->
select.isconst )
then
426 if( stk->scopenode <> NULL )
then
435 if( stk->
select.outerscopenode <> NULL )
then