31 byval sym
as FBSYMBOL
ptr, _
32 byval varexpr
as ASTNODE
ptr _
35 dim as ASTNODE
ptr idxexpr, dataOffset
38 if( astIsFIELD( varexpr ) )
then
43 if( symbIsParamByDesc( sym ) )
then
46 FB_DATATYPE_INTEGER, NULL, symb.fbarray_data )
50 FB_DATATYPE_INTEGER, NULL, _
51 symb.fbarray_dimtb + symb.fbarraydim_lbound )
59 idxexpr =
astNewBOP( AST_OP_ADD, idxexpr, dataOffset )
66 varexpr =
astNewVAR( sym, 0, FB_DATATYPE_INTEGER )
69 elseif( symbGetIsDynamic( sym ) )
then
71 idxexpr =
astNewVAR( symbGetArrayDescriptor( sym ), _
72 symb.fbarray_data, FB_DATATYPE_INTEGER )
75 dataOffset =
astNewVAR( symbGetArrayDescriptor( sym ), _
76 symb.fbarray_dimtb + symb.fbarraydim_lbound, _
85 idxexpr =
astNewBOP( AST_OP_ADD, idxexpr, dataOffset )
88 idxexpr =
astNewLOAD( idxexpr, FB_DATATYPE_INTEGER )
96 astGetSubType( varexpr ) ), FB_DATATYPE_UINT ) )
100 function =
astNewIDX( varexpr, idxexpr, _
101 astGetFullType( varexpr ), astGetSubType( varexpr ) )
108 byref expr
as ASTNODE
ptr, _
109 byref isptr
as integer, _
110 byval allow_const
as integer =
FALSE _
113 dim as FBSYMBOL
ptr s =
any
114 dim as integer nidx_array =
FALSE
127 expr =
cVarOrDeref( FB_VAREXPROPT_NOARRAYCHECK
or FB_VAREXPROPT_ALLOWADDROF
or FB_VAREXPROPT_ISEXPR )
128 if( expr = NULL )
then
133 if( astIsCAST( expr ) )
then
134 if( astGetCASTDoConv( expr ) =
FALSE )
then
135 dim as ASTNODE
ptr l = astGetLeft( expr )
141 select case as const astGetClass( expr )
143 case AST_NODECLASS_NIDXARRAY
145 dim as ASTNODE
ptr arrayexpr = astGetLeft( expr )
147 s = astGetSymbol( arrayexpr )
151 case AST_NODECLASS_ADDROF, AST_NODECLASS_OFFSET, _
152 AST_NODECLASS_DEREF, AST_NODECLASS_BOP
159 s = astGetSymbol( expr )
162 if( typeIsPtr( astGetDataType( expr ) ) )
then
171 isptr = typeIsPtr( symbGetType( s ) )
176 if( astIsIDX( expr ) =
FALSE )
then
181 elseif( isptr =
FALSE )
then
188 if( allow_const =
FALSE )
then
189 if( (typeGetConstMask( astGetFullType( expr ) )
and (1
shl (FB_DT_CONSTPOS +
iif( nidx_array, 0, 1 )))) )
then
190 errReport( FB_ERRMSG_CONSTANTCANTBECHANGED, TRUE )
202 byref mode
as integer, _
203 byref alphaexpr
as ASTNODE
ptr, _
204 byref funcexpr
as ASTNODE
ptr, _
205 byref paramexpr
as ASTNODE
ptr _
208 dim as FBSYMBOL
ptr s, arg1, arg2, arg3
216 mode = FBGFX_PUTMODE_AND
220 mode = FBGFX_PUTMODE_OR
224 mode = FBGFX_PUTMODE_XOR
230 mode = FBGFX_PUTMODE_PSET
234 mode = FBGFX_PUTMODE_PRESET
238 mode = FBGFX_PUTMODE_TRANS
242 mode = FBGFX_PUTMODE_ADD
244 if(
hMatch( CHAR_COMMA ) )
then
245 hMatchExpression( alphaexpr )
252 mode = FBGFX_PUTMODE_ALPHA
254 if(
hMatch( CHAR_COMMA ) )
then
255 hMatchExpression( alphaexpr )
256 mode = FBGFX_PUTMODE_BLEND
262 mode = FBGFX_PUTMODE_CUSTOM
266 hMatchExpression( funcexpr )
268 if(
hMatch( CHAR_COMMA ) )
then
269 hMatchExpression( paramexpr )
272 s = astGetSubType( funcexpr )
277 if( symbIsProc( s ) =
FALSE )
then
281 if( ( symbGetType( s ) <> FB_DATATYPE_UINT )
or _
282 ( symbGetProcParams( s ) <> 3 ) )
then
287 arg1 = symbGetProcHeadParam( s )
289 arg2 = symbGetParamNext( arg1 )
291 arg3 = symbGetParamNext( arg2 )
293 if( symbGetProcMode( s ) = FB_FUNCMODE_PASCAL )
then
297 if( ( symbGetType( arg1 ) <> FB_DATATYPE_UINT )
or _
298 ( symbGetType( arg2 ) <> FB_DATATYPE_UINT )
or _
299 ( typeIsPtr( symbGetType( arg3 ) ) =
FALSE )
or _
300 ( arg1->param.mode <> FB_PARAMMODE_BYVAL )
or _
301 ( arg2->param.mode <> FB_PARAMMODE_BYVAL )
or _
302 ( arg3->param.mode <> FB_PARAMMODE_BYVAL ) )
then
320 function cGfxPset(
byval ispreset
as integer )
as integer
321 dim as integer flags, tisptr
322 dim as ASTNODE
ptr xexpr, yexpr, cexpr, texpr
323 dim as FBSYMBOL
ptr target
329 if( (target <> NULL)
or (tisptr) )
then
334 if(
hMatch( FB_TK_STEP ) )
then
343 hMatchExpression( xexpr )
347 hMatchExpression( yexpr )
352 if(
hMatch( CHAR_COMMA ) )
then
353 hMatchExpression( cexpr )
360 function =
rtlGfxPset( texpr, tisptr, xexpr, yexpr, cexpr, flags, ispreset )
368 dim as integer flags, linetype, tisptr
369 dim as ASTNODE
ptr styleexpr, x1expr, y1expr, x2expr, y2expr, cexpr, texpr
370 dim as FBSYMBOL
ptr target
375 if(
hMatch( CHAR_MINUS ) )
then
385 if( (target <> NULL)
or (tisptr) )
then
390 if(
hMatch( FB_TK_STEP ) )
then
397 if(
hMatch( CHAR_LPRNT ) )
then
399 hMatchExpression( x1expr )
403 hMatchExpression( y1expr )
422 if(
hMatch( FB_TK_STEP ) )
then
439 hMatchExpression( x2expr )
443 hMatchExpression( y2expr )
451 if(
hMatch( CHAR_COMMA ) )
then
453 if( cexpr = NULL )
then
459 if(
hMatch( CHAR_COMMA ) )
then
470 if(
hMatch( CHAR_COMMA ) )
then
471 hMatchExpression( styleexpr )
480 function =
rtlGfxLine( texpr, tisptr, x1expr, y1expr, x2expr, y2expr, _
481 cexpr, linetype, styleexpr, flags )
489 dim as integer flags, fillflag, tisptr
490 dim as ASTNODE
ptr xexpr, yexpr, cexpr, radexpr, iniexpr, endexpr, aspexpr, texpr
491 dim as FBSYMBOL
ptr target
497 if( (target <> NULL)
or (tisptr) )
then
502 if(
hMatch( FB_TK_STEP ) )
then
511 hMatchExpression( xexpr )
515 hMatchExpression( yexpr )
522 hMatchExpression( radexpr )
530 if(
hMatch( CHAR_COMMA ) )
then
532 if( cexpr = NULL )
then
538 if(
hMatch( CHAR_COMMA ) )
then
542 if(
hMatch( CHAR_COMMA ) )
then
546 if(
hMatch( CHAR_COMMA ) )
then
550 if(
hMatch( CHAR_COMMA ) )
then
552 errReport( FB_ERRMSG_EXPECTEDEXPRESSION )
568 function =
rtlGfxCircle( texpr, tisptr, xexpr, yexpr, radexpr, cexpr, _
569 aspexpr, iniexpr, endexpr, fillflag, flags )
577 dim as ASTNODE
ptr xexpr, yexpr, pexpr, bexpr, texpr
578 dim as integer flags, tisptr
579 dim as FBSYMBOL
ptr target
585 if( (target <> NULL)
or (tisptr) )
then
590 if(
hMatch( FB_TK_STEP ) )
then
599 hMatchExpression( xexpr )
603 hMatchExpression( yexpr )
611 if(
hMatch( CHAR_COMMA ) )
then
615 if(
hMatch( CHAR_COMMA ) )
then
616 hMatchExpression( bexpr )
620 if( pexpr = NULL )
then
625 if( bexpr = NULL )
then
630 function =
rtlGfxPaint( texpr, tisptr, xexpr, yexpr, pexpr, bexpr, flags )
638 dim as ASTNODE
ptr texpr, xexpr, yexpr, sexpr, cexpr, fexpr, alphaexpr, funcexpr, paramexpr
639 dim as integer tisptr, fisptr, flags, mode
640 dim as FBSYMBOL
ptr target
648 if( (target <> NULL)
or (tisptr) )
then
653 if(
hMatch( FB_TK_STEP ) )
then
662 hMatchExpression( xexpr )
666 hMatchExpression( yexpr )
673 hMatchExpression( sexpr )
680 mode = FBGFX_PUTMODE_TRANS
683 if(
hMatch( CHAR_COMMA ) )
then
687 if(
hMatch( CHAR_COMMA ) )
then
691 if(
hMatch( CHAR_COMMA ) )
then
692 if(
hGetMode( mode, alphaexpr, funcexpr, paramexpr ) =
FALSE )
then
699 if( cexpr = NULL )
then
704 function =
rtlGfxDrawString( texpr, tisptr, xexpr, yexpr, sexpr, cexpr, fexpr, fisptr, flags, mode, alphaexpr, funcexpr, paramexpr )
712 dim as ASTNODE
ptr cexpr, texpr
713 dim as integer tisptr
714 dim as FBSYMBOL
ptr target
719 if(
hMatch( FB_TK_STRING ) )
then
727 case CHAR_COMMA, CHAR_DOT
729 if( (target = NULL)
and (tisptr =
FALSE) )
then
730 errReport( FB_ERRMSG_EXPECTEDEXPRESSION )
737 hMatchExpression( cexpr )
746 function cGfxView(
byval isview
as integer )
as integer
748 dim as ASTNODE
ptr x1expr, y1expr, x2expr, y2expr, fillexpr, bordexpr
754 case FB_TK_SCREEN, FB_TK_SCREENQB
769 if(
hMatch( CHAR_LPRNT ) )
then
771 hMatchExpression( x1expr )
775 hMatchExpression( y1expr )
788 hMatchExpression( x2expr )
792 hMatchExpression( y2expr )
799 if(
hMatch( CHAR_COMMA ) )
then
801 if( fillexpr <> NULL )
then
806 if(
hMatch( CHAR_COMMA ) )
then
807 hMatchExpression( bordexpr )
817 function =
rtlGfxView( x1expr, y1expr, x2expr, y2expr, fillexpr, bordexpr, flags )
819 function =
rtlGfxWindow( x1expr, y1expr, x2expr, y2expr, flags )
828 dim as ASTNODE
ptr arrayexpr, attexpr, rexpr, gexpr, bexpr
829 dim as FBSYMBOL
ptr s
830 dim as integer isget, isptr
841 if(
hMatch( FB_TK_USING ) )
then
844 if( (s = NULL)
and (isptr =
FALSE) )
then
845 errReport( FB_ERRMSG_EXPECTEDIDENTIFIER )
859 if( attexpr <> NULL )
then
864 if( rexpr = NULL )
then
865 errReport( FB_ERRMSG_EXPECTEDIDENTIFIER )
869 hMatchExpression( rexpr )
872 if(
hMatch( CHAR_COMMA ) )
then
875 if( gexpr = NULL )
then
876 errReport( FB_ERRMSG_EXPECTEDIDENTIFIER )
880 hMatchExpression( gexpr )
887 if( bexpr = NULL )
then
888 errReport( FB_ERRMSG_EXPECTEDIDENTIFIER )
892 hMatchExpression( bexpr )
897 errReport( FB_ERRMSG_EXPECTEDEXPRESSION )
902 dim as integer has_const =
FALSE
904 has_const
or=
iif( rexpr, typeIsConst( astGetFullType( rexpr ) ),
FALSE )
905 has_const
or=
iif( gexpr, typeIsConst( astGetFullType( gexpr ) ),
FALSE )
906 has_const
or=
iif( bexpr, typeIsConst( astGetFullType( bexpr ) ),
FALSE )
910 errReport( FB_ERRMSG_CONSTANTCANTBECHANGED, TRUE )
913 function =
rtlGfxPalette( attexpr, rexpr, gexpr, bexpr, isget )
923 dim as integer coordtype, mode, isptr, tisptr, expectmode
924 dim as ASTNODE
ptr xexpr, yexpr, arrayexpr, texpr, alphaexpr, _
925 funcexpr, paramexpr, x1expr, y1expr, x2expr, y2expr
926 dim as FBSYMBOL
ptr s, target, arg1, arg2
937 if( (target <> NULL)
or (tisptr) )
then
942 if(
hMatch( FB_TK_STEP ) )
then
951 hMatchExpression( xexpr )
955 hMatchExpression( yexpr )
963 if( (s = NULL)
and (isptr =
FALSE) )
then
964 errReport( FB_ERRMSG_EXPECTEDIDENTIFIER )
969 mode = FBGFX_PUTMODE_XOR
970 if(
hMatch( CHAR_COMMA ) )
then
974 if(
hMatch( CHAR_LPRNT ) )
then
976 hMatchExpression( x1expr )
978 hMatchExpression( y1expr )
987 if(
hMatch( FB_TK_STEP ) )
then
996 hMatchExpression( x2expr )
998 hMatchExpression( y2expr )
1006 if( expectmode )
then
1007 if(
hGetMode( mode, alphaexpr, funcexpr, paramexpr ) =
FALSE )
then
1014 function =
rtlGfxPut( texpr, tisptr, xexpr, yexpr, arrayexpr, isptr, _
1015 x1expr, y1expr, x2expr, y2expr, _
1016 mode, alphaexpr, funcexpr, paramexpr, coordtype )
1024 dim as integer coordtype, isptr, tisptr
1025 dim as ASTNODE
ptr x1expr, y1expr, x2expr, y2expr, arrayexpr, texpr
1026 dim as FBSYMBOL
ptr s, target
1032 if( (target <> NULL)
or (tisptr) )
then
1037 if(
hMatch( FB_TK_STEP ) )
then
1046 hMatchExpression( x1expr )
1050 hMatchExpression( y1expr )
1061 if(
hMatch( FB_TK_STEP ) )
then
1078 hMatchExpression( x2expr )
1082 hMatchExpression( y2expr )
1090 if( (s = NULL)
and (isptr =
FALSE) )
then
1091 errReport( FB_ERRMSG_EXPECTEDIDENTIFIER )
1096 function =
rtlGfxGet( texpr, tisptr, x1expr, y1expr, x2expr, y2expr, _
1097 arrayexpr, isptr, s, coordtype )
1108 if( isqb =
FALSE )
then
1113 dim as ASTNODE
ptr dexpr = NULL
1114 if(
hMatch( CHAR_COMMA ) )
then
1119 dim as ASTNODE
ptr pexpr = NULL
1120 if(
hMatch( CHAR_COMMA ) )
then
1125 if( mexpr = NULL )
then
1130 dim as ASTNODE
ptr fexpr = NULL
1131 if(
hMatch( CHAR_COMMA ) )
then
1136 dim as ASTNODE
ptr rexpr = NULL
1137 if(
hMatch( CHAR_COMMA ) )
then
1148 if(
hMatch( CHAR_COMMA ) )
then
1150 if( cswitch <> NULL )
then
1157 dim as ASTNODE
ptr active = NULL
1158 if(
hMatch( CHAR_COMMA ) )
then
1163 dim as ASTNODE
ptr visible = NULL
1164 if(
hMatch( CHAR_COMMA ) )
then
1168 if( mode = NULL )
then
1180 function cGfxPoint(
byref funcexpr
as ASTNODE
ptr )
as integer
1181 dim as ASTNODE
ptr xexpr, yexpr, texpr
1182 dim as integer tisptr
1183 dim as FBSYMBOL
ptr target
1189 hMatchExpression( xexpr )
1194 if(
hMatch( CHAR_COMMA ) )
then
1195 hMatchExpression( yexpr )
1197 if(
hMatch( CHAR_COMMA ) )
then
1199 if( (target = NULL)
and (tisptr =
FALSE) )
then
1200 errReport( FB_ERRMSG_EXPECTEDEXPRESSION )
1208 funcexpr =
rtlGfxPoint( texpr, tisptr, xexpr, yexpr )
1210 function = funcexpr <> NULL
1218 dim as ASTNODE
ptr wexpr, hexpr, cexpr, dexpr
1219 dim as integer flags
1225 hMatchExpression( wexpr )
1229 hMatchExpression( hexpr )
1235 if(
hMatch( CHAR_COMMA ) )
then
1237 if( cexpr <> NULL )
then
1240 if(
hMatch( CHAR_COMMA ) )
then
1241 hMatchExpression( dexpr )
1249 function = funcexpr <> NULL
1253 #macro CHECK_CODEMASK( )
1254 if( cCompStmtIsAllowed( FB_CMPSTMT_MASK_CODE ) =
FALSE )
then
1263 byval tk
as FB_TOKEN _
1268 select case as const tk
1272 function = cGfxPSet(
FALSE )
1277 function = cGfxPSet( TRUE )
1341 byval tk
as FB_TOKEN _
1344 dim as ASTNODE
ptr expr = NULL
1351 case FB_TK_IMAGECREATE