15 #include once "datetime.bi"
16 #include once "string.bi"
60 (@
"__FB_VERSION__" , @FB_VERSION , 0, NULL ), _
61 (@
"__FB_BUILD_DATE__" , @FB_BUILD_DATE , 0, NULL ), _
62 (@
"__FB_VER_MAJOR__" , @FB_VER_STR_MAJOR , 1, NULL ), _
63 (@
"__FB_VER_MINOR__" , @FB_VER_STR_MINOR , 1, NULL ), _
64 (@
"__FB_VER_PATCH__" , @FB_VER_STR_PATCH , 1, NULL ), _
65 (@
"__FB_SIGNATURE__" , @FB_SIGN , 0, NULL ), _
99 function = env.inf.
name
113 if( symbGetIsMainProc( parser.currproc ) )
then
114 function = FB_MAINPROCNAME
115 elseif( symbGetIsModLevelProc( parser.currproc ) )
then
116 function = FB_MODLEVELNAME
126 function =
str( lexLineNum( ) )
140 function =
format(
now( ),
"yyyy-mm-dd" )
154 function =
str( env.clopt.multithreaded )
161 function =
str( env.opt.parammode = FB_PARAMMODE_BYVAL )
168 function =
str( env.opt.
dynamic = TRUE )
175 function =
str( env.opt.escapestr = TRUE )
182 function =
str( env.opt.
explicit = TRUE )
189 function =
str( env.opt.procpublic = FALSE )
196 function =
str( env.opt.
gosub = TRUE )
203 function =
str( env.clopt.outtype = FB_OUTTYPE_EXECUTABLE )
210 function =
str( env.clopt.outtype = FB_OUTTYPE_STATICLIB )
217 function =
str( env.clopt.outtype = FB_OUTTYPE_DYNAMICLIB )
224 function =
str( env.clopt.outtype = FB_OUTTYPE_OBJECT )
231 function =
str( env.clopt.debug )
237 dim as integer res = &h0000
239 if( env.clopt.errorcheck )
then
243 if( env.clopt.resumeerr )
then
247 if( env.clopt.extraerrchk )
then
251 function =
str( res )
264 select case env.clopt.backend
292 case FB_FPMODE_PRECISE
303 function =
str( (env.clopt.backend = FB_BACKEND_GCC) )
309 byval ismain
as integer _
313 dim as const zstring ptr def =
any
315 listInit( @symb.def.paramlist, FB_INITDEFARGNODES,
len( FB_DEFPARAM ), LIST_FLAGS_NOCLEAR )
316 listInit( @symb.def.toklist, FB_INITDEFTOKNODES,
len( FB_DEFTOK ), LIST_FLAGS_NOCLEAR )
336 symbAddDefine(
"__FB_" +
ucase( *env.target.id ) +
"__", NULL, 0 )
339 if( env.target.options
and FB_TARGETOPT_UNIX )
then
346 if( fbCpuTypeIs64bit( ) )
then
356 if( env.clopt.fputype >= FB_FPUTYPE_SSE )
then
361 value =
str( env.clopt.vectorize )
367 hashInit( @symb.def.paramhash, FB_MAXDEFINEARGS )
387 byval symbol
as const zstring ptr, _
388 byval text
as zstring ptr, _
389 byval lgt
as integer, _
390 byval isargless
as integer, _
391 byval proc as FBS_DEFINE_PROC, _
392 byval flags as FB_DEFINE_FLAGS _
395 dim as FBSYMBOL
ptr sym =
any
402 NULL, @symbGetGlobalHashTb( ), _
403 FB_SYMBCLASS_DEFINE, _
405 FB_DATATYPE_CHAR, NULL )
406 if( sym = NULL )
then
410 sym->def.text = ZstrAllocate( lgt )
411 *sym->def.text = *text
414 sym->def.paramhead = NULL
415 sym->def.isargless = isargless
426 byval symbol
as zstring ptr, _
427 byval text
as wstring ptr, _
428 byval lgt
as integer, _
429 byval isargless
as integer, _
430 byval proc as FBS_DEFINE_PROC, _
431 byval flags as FB_DEFINE_FLAGS _
434 dim as FBSYMBOL
ptr sym =
any
441 NULL, @symbGetGlobalHashTb( ), _
442 FB_SYMBCLASS_DEFINE, _
444 FB_DATATYPE_WCHAR, NULL )
445 if( sym = NULL )
then
449 sym->def.textw = WstrAllocate( lgt )
450 *sym->def.textw = *text
453 sym->def.paramhead = NULL
454 sym->def.isargless = isargless
465 byval symbol
as const zstring ptr, _
466 byval tokhead
as FB_DEFTOK
ptr, _
467 byval params
as integer, _
468 byval paramhead
as FB_DEFPARAM
ptr, _
469 byval flags as FB_DEFINE_FLAGS _
472 dim as FBSYMBOL
ptr sym =
any
479 NULL, @symbGetGlobalHashTb( ), _
480 FB_SYMBCLASS_DEFINE, _
482 FB_DATATYPE_INVALID, NULL )
483 if( sym = NULL )
then
487 sym->def.tokhead = tokhead
488 sym->def.params = params
489 sym->def.paramhead = paramhead
490 sym->def.isargless = FALSE
502 for i = 0
to symb.def.param-1
503 hashDel( @symb.def.paramhash, symb.def.hash(i).item, symb.def.hash(i).index )
513 byval lastparam
as FB_DEFPARAM
ptr, _
514 byval id
as const zstring ptr _
515 )
as FB_DEFPARAM
ptr static
517 dim as FB_DEFPARAM
ptr param
518 dim as uinteger index
524 if( lastparam <> NULL )
then
525 lastparam->
next = param
530 if( symb.def.param > 0 )
then
536 param->
name = ZstrAllocate(
len( *id ) )
544 ZstrFree( param->
name )
549 symb.def.hash(symb.def.param).item =
hashAdd( @symb.def.paramhash, _
554 symb.def.hash(symb.def.param).index = index
557 param->num = symb.def.param
569 byval lasttok
as FB_DEFTOK
ptr, _
570 byval dtype
as FB_DEFTOK_TYPE _
571 )
as FB_DEFTOK
ptr static
573 dim t
as FB_DEFTOK
ptr
579 if( lasttok <> NULL )
then
588 select case as const dtype
589 case FB_DEFTOK_TYPE_TEX
591 case FB_DEFTOK_TYPE_TEXW
602 byval tok
as FB_DEFTOK
ptr _
603 )
as FB_DEFTOK
ptr static
606 if( tok->prev <> NULL )
then
607 tok->prev->
next = NULL
613 select case tok->
type
614 case FB_DEFTOK_TYPE_TEX
615 ZstrFree( tok->text )
616 case FB_DEFTOK_TYPE_TEXW
617 WstrFree( tok->textw )
626 dim as FB_DEFPARAM
ptr param, nxt
628 param = s->def.paramhead
629 do while( param <> NULL )
631 ZstrFree( param->
name )
642 dim as FB_DEFTOK
ptr tok, nxt
645 do while( tok <> NULL )
658 byval s
as FBSYMBOL
ptr _
668 if( symbGetDefineParams( s ) = 0 )
then
669 if( symbGetType( s ) <> FB_DATATYPE_WCHAR )
then
670 ZstrFree( s->def.text )
672 WstrFree( s->def.textw )