FreeBASIC  0.91.0
symb.bi
Go to the documentation of this file.
1 ''
2 '' symbol table protos
3 ''
4 
5 #include once "list.bi"
6 #include once "pool.bi"
7 #include once "ast-op.bi"
8 
9 ''
11  FB_DATACLASS_INTEGER '' must be the first
16 end enum
17 
44 end enum
45 
47 
48 const FB_DT_TYPEMASK = &b00000000000000000000000000011111 '' max 32 built-in dts
49 const FB_DT_PTRMASK = &b00000000000000000000000111100000
50 const FB_DT_CONSTMASK = &b00000000000000111111111000000000 '' PTRLEVELS + 1 bit-masks
51 const FB_DATATYPE_ARRAY = &b00000000000010000000000000000000 '' used when mangling
52 const FB_DATATYPE_REFERENCE = &b00000000000100000000000000000000 '' ditto
53 const FB_DATATYPE_INVALID = &b10000000000000000000000000000000
54 
55 const FB_DT_PTRLEVELS = 8 '' max levels of pointer indirection
56 
57 const FB_DT_PTRPOS = 5
59 
60 enum
71 end enum
72 
73 '' symbol classes
74 '' When changing, update symb.bas:symbDump():classnames
90  FB_SYMBCLASS_FWDREF '' forward definition
92  FB_SYMBCLASS_NSIMPORT '' namespace import (an USING)
93 end enum
94 
95 '' symbol state mask
98  FB_SYMBSTATS_ACCESSED = &h00000002
101  FB_SYMBSTATS_IMPLICIT = &h00000010 '' VARs only: implicitly generated by compiler (symbAddImplicitVar()), not explicitly defined in source code
102  FB_SYMBSTATS_RTL = &h00000020
104  FB_SYMBSTATS_PARSED = &h00000080
105  FB_SYMBSTATS_RTTITABLE = &h00000100 '' VARs only: it's an rtti table (used for name mangling)
107  FB_SYMBSTATS_VTABLE = &h00000400 '' VARs only: it's a vtable (used for name mangling)
111  FB_SYMBSTATS_FUNCPTR = &h00004000 '' needed to demangle
112  FB_SYMBSTATS_JUMPTB = &h00008000 '' ASM backend's fake jumptb vars only
115  FB_SYMBSTATS_CANTDUP = &h00040000
116  FB_SYMBSTATS_GCCBUILTIN = &h00080000 '' procs only
117  FB_SYMBSTATS_IRHLCBUILTIN = &h00100000 '' procs only
118  ''= &h00200000
119  FB_SYMBSTATS_HASRTTI = &h00400000
121  FB_SYMBSTATS_UNIONFIELD = &h01000000 '' fields only
122  FB_SYMBSTATS_RTL_CONST = &h02000000 '' params only
123  FB_SYMBSTATS_EMITTED = &h04000000 '' needed by high-level IRs, to avoid emitting structs etc twice
124  FB_SYMBSTATS_BEINGEMITTED = &h08000000 '' ditto, for circular dependencies with structs
125 
126  '' reuse - take care
130 
131  '' A wchar ptr var that needs deallocating at scope breaks/end.
132  '' (Cheap dynamic wstring used by the 'SELECT CASE wstring' temporary,
133  '' there is no real FB_DATATYPE_WSTRING yet)
135 end enum
136 
137 '' symbol attributes mask
139  FB_SYMBATTRIB_NONE = &h00000000
140 
141  FB_SYMBATTRIB_SHARED = &h00000001
142  FB_SYMBATTRIB_STATIC = &h00000002
144  FB_SYMBATTRIB_COMMON = &h00000008
145  FB_SYMBATTRIB_EXTERN = &h00000010 '' extern's become public when DIM'ed
146  FB_SYMBATTRIB_PUBLIC = &h00000020
148  FB_SYMBATTRIB_LOCAL = &h00000080
149  FB_SYMBATTRIB_EXPORT = &h00000100
150  FB_SYMBATTRIB_IMPORT = &h00000200
152  FB_SYMBATTRIB_METHOD = &h00000800 '' Non-STATIC UDT member procs, i.e. procs with implicit THIS ptr
153  FB_SYMBATTRIB_CONSTRUCTOR = &h00001000 '' methods only
154  FB_SYMBATTRIB_DESTRUCTOR = &h00002000 '' /
156  FB_SYMBATTRIB_PROPERTY = &h00008000 '' /
161  FB_SYMBATTRIB_CONST = &h00100000
162  FB_SYMBATTRIB_OPTIONAL = &h00200000 '' params only
163  FB_SYMBATTRIB_TEMP = &h00400000
166  FB_SYMBATTRIB_RETURNSBYREF = &h02000000 '' procedures only
167  FB_SYMBATTRIB_VIS_PRIVATE = &h04000000 '' UDT members only
168  FB_SYMBATTRIB_VIS_PROTECTED = &h08000000 '' ditto
169  FB_SYMBATTRIB_NAKED = &h10000000 '' procedures only
170  FB_SYMBATTRIB_VIRTUAL = &h20000000 '' methods only: all virtuals (normal and pure)
171  FB_SYMBATTRIB_ABSTRACT = &h40000000 '' methods only: pure virtuals (only)
172 
174 
175  '' reuse - take care
179 end enum
180 
181 '' parameter modes
183  FB_PARAMMODE_BYVAL = 1 '' must start at 1! used for mangling
187 end enum
188 
189 '' call conventions
191  FB_FUNCMODE_STDCALL = 1 '' ditto
192  FB_FUNCMODE_STDCALL_MS '' ms/vb-style: don't include the @n suffix
195 
196  '' Symbolic constant to represent FBCALL, telling cProcCallingConv()
197  '' and the RTL procedure definitions to use env.target.fbcall which
198  '' will be the real FB_FUNCMODE_* implementing FBCALL depending on the
199  '' compilation target.
201 end enum
202 
203 '' options when adding new symbols
205  FB_SYMBOPT_NONE = &h00000000
206 
208  FB_SYMBOPT_UNSCOPE = &h00000002
209  FB_SYMBOPT_DECLARING = &h00000004
211  FB_SYMBOPT_RTL = &h00000010
212  FB_SYMBOPT_DOHASH = &h00000020
215 end enum
216 
217 '' options when looking up symbols
220 
223 end enum
224 
225 ''
233 end enum
234 
236 
237 #ifndef ASTNODE_
239 #endif
240 
241 #ifndef EMIT_NODE_
243 #endif
244 
245 ''
249 end type
250 
252  lower as longint
253  upper as longint
254 end type
255 
256 '' Special value to represent the case where '...' ellipsis was given as ubound
257 const FB_ARRAYDIM_UNKNOWN = &h8000000000000000ll
258 
260  lower as longint
261  upper as longint
262  next as FBVARDIM ptr
263 end type
264 
265 ''
267  sym as FBSYMBOL_ ptr '' first symbol
269  isimport as integer
270 
271  '' all fields below are only set when importing (with USING) a ns
273  item as HASHITEM ptr
275 end type
276 
277 ''
279  owner as FBSYMBOL_ ptr '' back link
281  prev as FBHASHTB ptr '' prev node in the current hash tbs lookup list
282  next as FBHASHTB ptr '' next //
283 end type
284 
286  tb as FBHASHTB ptr '' parent's hash tb
287  item as HASHITEM ptr '' hash item, for fast deletion
288  index as uinteger '' ditto
289  prev as FBSYMBOL_ ptr '' prev duplicated symbol
290  next as FBSYMBOL_ ptr '' next //
291 end type
292 
293 ''
295  owner as FBSYMBOL_ ptr '' back link
296  head as FBSYMBOL_ ptr '' first node
297  tail as FBSYMBOL_ ptr '' last node
298 end type
299 
300 ''
302  implist as FBSYMLIST '' all namespaces imported by this ns
303  explist as FBSYMLIST '' all namespaces importing this ns
304  cnt as integer '' times this ns was imported/nested
305  impsym_head as FBSYMCHAIN ptr '' imported symbols by the last USING
307 end type
308 
313 end type
314 
315 union FBVALUE
316  s as FBSYMBOL_ ptr
317  i as longint
318  f as double
319 end union
320 
321 '' keyword
323  id as integer
325 end type
326 
327 '' define or macro
329  name as zstring ptr
330  num as integer
332 end type
333 
339 end enum
340 
343 
344  union
345  text as zstring ptr
346  textw as wstring ptr
347  paramnum as integer
348  end union
349 
352 end type
353 
355  FB_DEFINE_FLAGS_NONE = &h00000000
356  FB_DEFINE_FLAGS_STR = &h00000000
357  FB_DEFINE_FLAGS_NUM = &h00000001
360 end enum
361 
362 type FBS_DEFINE_PROC as function( ) as string
363 
365  params as integer
367 
368  union
369  tokhead as FB_DEFTOK ptr '' only if args > 0
370  text as zstring ptr '' // = 0
371  textw as wstring ptr
372  end union
373 
374  isargless as integer
375  flags as FB_DEFINE_FLAGS '' bit 0: 1=numeric, 0=string
377 end type
378 
379 '' forward definition
381  ref as FBSYMBOL_ ptr '' The user that has to be backpatched
382  prev as FBFWDREF ptr
383 end type
384 
386  tail as FBFWDREF ptr '' List of users of this fwdref
387 end type
388 
389 '' label
391  parent as FBSYMBOL_ ptr '' parent block, not always a proc
392  declared as integer
393  stmtnum as integer '' can't use colnum as it's unreliable
394 end type
395 
396 '' structure
413 end enum
414 
416  typenum as integer
417 end type
418 
420  ctorhead as FBSYMBOL_ ptr '' ctor head (first overload proc) or NULL
421  defctor as FBSYMBOL_ ptr '' default ctor or NULL
422  copyctor as FBSYMBOL_ ptr '' copy ctor or NULL
423  dtor as FBSYMBOL_ ptr '' destructor or NULL
424  clone as FBSYMBOL_ ptr '' LET overload proc or NULL
425  opovlTb(0 to AST_OP_SELFOPS-1) as FBSYMBOL_ ptr
426  vtableelements as integer '' vtable elements counter
427  vtable as FBSYMBOL_ ptr '' virtual-functions table struct
428  rtti as FBSYMBOL_ ptr '' Run-Time Type Info struct
429  abstractcount as integer '' ABSTRACT method counter (to determine abstract classes, which aren't allowed to be instantiated)
430 end type
431 
433  '' extends FBNAMESCP
435 
436  base as FBSYMBOL_ ptr '' base class
438  natalign as integer '' UDT's natural alignment based on largest natural field alignment
439  unpadlgt as longint '' unpadded len
440  options as short '' FB_UDTOPT
441  bitpos as ubyte
442  align as ubyte
443 
444  '' real type used to return this UDT from functions
446 
449 end type
450 
452  bitpos as integer
453  bits as integer
454 end type
455 
456 '' enumeration
458  '' extends FBNAMESPC
460 
461  elements as integer
463 end type
464 
465 type FB_CALL_ARG '' used by overloaded function calls
466  expr as ASTNODE_ ptr
469 end type
470 
472  args as integer
475 end type
476 
477 '' function param
480  var as FBSYMBOL_ ptr '' link to decl var in func bodies
481  optexpr as ASTNODE_ ptr '' default value
482 end type
483 
484 '' function
485 type FBRTLCALLBACK as function( byval sym as FBSYMBOL_ ptr ) as integer
486 
488  minparams as short
489  maxparams as short
491 end type
492 
493 '' used by x86 ASM emitter only
495  argofs as integer
496  localofs as integer
497  localmax as integer
498 end type
499 
501  iniline as integer '' sub|function
502  endline as integer '' end sub|function
503  incfile as zstring ptr
504 end type
505 
507  lasthnd as FBSYMBOL_ ptr '' last error handler
508  lastmod as FBSYMBOL_ ptr '' last module name
509  lastfun as FBSYMBOL_ ptr '' last function name
510 end type
511 
514 end type
515 
518  sym as FBSYMBOL_ ptr '' for symbol
519 end type
520 
525 end enum
526 
528  ctx as FBSYMBOL_ ptr '' local pointer for gosub stack
529 end type
530 
532  res as FBSYMBOL_ ptr '' result, if any
533  stk as FB_PROCSTK '' to keep track of the stack frame
534  dbg as FB_PROCDBG '' debugging
537  statdtor as TLIST ptr '' list of static instances with dtors
539  stmtnum as integer
540  priority as integer
542  base_initree as ASTNODE_ ptr '' base() ctorcall/initializer given in constructor bodies
543 
544  '' virtual methods:
545  '' vtable array index, location of the procptr in the vtbl
546  '' methods that override a virtual method:
547  '' vtable index of the virtual method that's overridden by this one
548  '' other methods:
549  '' 0
550  '' A valid index must be >= 2 since the first two vtable elements are
551  '' the null pointer and the rtti pointer.
552  vtableindex as integer
553 
554  '' For methods that override a virtual method: the method that's
555  '' overridden (if any); or else NULL.
557 end type
558 
561 end type
562 
566  FB_RETURN_DEFAULT '' if none specified, take from the proto
567 end enum
568 
569 
571  symtb as FBSYMBOLTB '' local symbols table
572  params as short
573  optparams as short '' number of optional/default params
574  paramtb as FBSYMBOLTB '' parameters symbol tb
575  mode as FB_FUNCMODE '' calling convention
576 
577  '' result type remapped to what it will be emitted as, including CONSTs
580 
583  ovl as FB_PROCOVL '' overloading
584  ext as FB_PROCEXT ptr '' extra fields, not used with prototypes
585 end type
586 
587 '' scope
589  iniline as integer '' scope
590  endline as integer '' end scope
593 end type
594 
595 '' used by x86 ASM emitter only
597  baseofs as integer
598 end type
599 
605 end type
606 
607 '' variable
609  dims as integer
612  dif as longint
613  elms as longint
615  has_ellipsis as integer
616 end type
617 
619  array as FBSYMBOL_ ptr '' back-link
620 end type
621 
624 end type
625 
627  union
628  littext as zstring ptr
629  littextw as wstring ptr
631  end union
634  stmtnum as integer '' can't use colnum as it's unreliable
635  align as integer '' 0 = use default alignment
636  data as FBVAR_DATA '' used with DATA stmts
637 end type
638 
639 '' namespace
641  '' extends FBNAMESPC
643 
644  cnt as integer '' times this ns was re-opened
645  last_tail as FBSYMBOL_ ptr '' point to last tail
646 end type
647 
648 '' namespace import (USING)
650  '' imported ns (src)
654  '' exported ns (dst)
658 end type
659 
660 ''
662  name as zstring ptr '' upper-cased name, shared by hash tb
663  alias as zstring ptr '' alias/preserved (if EXTERN was used) name
664  mangled as zstring ptr '' mangled name
665 end type
666 
667 ''
669  class as FB_SYMBCLASS
672 
674 
677 
678  scope as ushort
679  mangling as short '' FB_MANGLING
680 
681  lgt as longint
682  ofs as longint '' for local vars, args, UDT's and fields
683 
684  union
686  val as FBVALUE '' constants
699  end union
700 
701  hash as FBSYMHASH '' hash tb (namespace) it's part of
702 
703  symtb as FBSYMBOLTB ptr '' symbol tb it's part of
704 
706 
707  prev as FBSYMBOL ptr '' next in symbol tb list
708  next as FBSYMBOL ptr '' prev /
709 end type
710 
712  head as FBHASHTB ptr
713  tail as FBHASHTB ptr
714 end type
715 
717  item as HASHITEM ptr
718  index as uinteger
719 end type
720 
722  paramlist as TLIST '' define parameters
723  toklist as TLIST '' define tokens
724 
725  '' macros only..
726  param as integer '' param count
728  hash(0 to FB_MAXDEFINEARGS-1) as SYMB_DEF_PARAM
729 end type
730 
732  head as FBSYMBOL ptr '' head proc
733 end type
734 
736  sym as FBSYMBOL ptr
738 end type
739 
744 end type
745 
749 End Type
750 
751 const CHAINPOOL_SIZE = 1 shl 12
752 
754  inited as integer
755 
756  symlist as TLIST '' (of FBSYMBOL)
758 
759  '' FBSYMCHAIN's are allocated from this buffer
761  chainpoolhead as integer
762 
763  globnspc as FBSYMBOL '' global namespace
764 
765  namespc as FBSYMBOL ptr '' current ns
766  hashtb as FBHASHTB ptr '' current hash tb
767  symtb as FBSYMBOLTB ptr '' current symbol tb
768 
769  neststk as TSTACK '' nest stack (namespace/class nesting)
770  imphashtb as THASH '' imported symbol (USING) tb
771  imphashlist as TLIST '' (of FBSYMHASH)
772 
774 
775  dimlist as TLIST '' array dimensions
776 
777  fwdlist as TLIST '' forward typedef refs
778 
779  nsextlist as TLIST '' of FBNAMESPC_EXT
780 
781  fwdrefcnt as integer
782 
783  def as SYMB_DEF_CTX '' #define context
784 
786 
787  globctorlist as FB_GLOBCTORLIST '' global ctors list
788  globdtorlist as FB_GLOBCTORLIST '' global dtors list
789 
791  0 to AST_OPCODES-1 _
792  ) as SYMB_OVLOP '' global operator overloading
793 
794  fbarray as FBSYMBOL ptr '' FBARRAY (array descriptor)
795  fbarray_data as integer '' offsetof( FBARRAY, data )
796  fbarray_dimtb as integer '' offsetof( FBARRAY, dimTB )
797  fbarraydim as FBSYMBOL ptr '' FBARRAYDIM (dimTB element structure)
798  fbarraydim_lbound as integer '' offsetof( FBARRAYDIM, lbound )
799  fbarraydim_ubound as integer '' offsetof( FBARRAYDIM, ubound )
800 
802 end type
803 
805  class as FB_DATACLASS '' INTEGER, FPOINT
806  size as integer '' in bytes
807  signed as integer '' TRUE or FALSE
808 
809  '' For basic integer types only: ranking value, to establish a proper
810  '' target-specific (32bit/64bit) order (the FB_DATATYPE enum order is
811  '' not enough because it's not target-specific)
812  intrank as integer
813 
814  remaptype as FB_DATATYPE '' remapped type for ENUM, POINTER, etc
815  sizetype as integer '' FB_SIZETYPE_*
816  name as const zstring ptr
817 end type
818 
819 
820 #include once "ast.bi"
821 
822 declare sub symbInit _
823  ( _
824  byval ismain as integer _
825  )
826 
827 declare sub symbEnd _
828  ( _
829  _
830  )
831 
832 declare sub symbDataInit( )
833 
834 declare function symbLookup _
835  ( _
836  byval id as zstring ptr, _
837  byref tk as FB_TOKEN, _
838  byref tk_class as FB_TKCLASS, _
839  byval preserve_case as integer = FALSE _
840  ) as FBSYMCHAIN ptr
841 
842 declare function symbLookupAt _
843  ( _
844  byval ns as FBSYMBOL ptr, _
845  byval id as const zstring ptr, _
846  byval preserve_case as integer = FALSE, _
847  byval search_imports as integer = TRUE _
848  ) as FBSYMCHAIN ptr
849 
850 declare function symbFindByClass _
851  ( _
852  byval chain as FBSYMCHAIN ptr, _
853  byval class as integer _
854  ) as FBSYMBOL ptr
855 
856 declare function symbFindVarBySuffix _
857  ( _
858  byval chain as FBSYMCHAIN ptr, _
859  byval suffix as integer _
860  ) as FBSYMBOL ptr
861 
862 declare function symbFindVarByDefType _
863  ( _
864  byval chain as FBSYMCHAIN ptr, _
865  byval dtype as integer _
866  ) as FBSYMBOL ptr
867 
868 declare function symbFindVarByType _
869  ( _
870  byval chain as FBSYMCHAIN ptr, _
871  byval dtype as integer _
872  ) as FBSYMBOL ptr
873 
874 declare function symbLookupByNameAndClass _
875  ( _
876  byval ns as FBSYMBOL ptr, _
877  byval symbol as const zstring ptr, _
878  byval class as integer, _
879  byval preservecase as integer = FALSE, _
880  byval search_imports as integer = TRUE _
881  ) as FBSYMBOL ptr
882 
883 declare function symbLookupByNameAndSuffix _
884  ( _
885  byval ns as FBSYMBOL ptr, _
886  byval symbol as zstring ptr, _
887  byval suffix as integer, _
888  byval preservecase as integer = FALSE, _
889  byval search_imports as integer = TRUE _
890  ) as FBSYMBOL ptr
891 
892 declare function symbFindOverloadProc _
893  ( _
894  byval parent as FBSYMBOL ptr, _
895  byval proc as FBSYMBOL ptr, _
897  ) as FBSYMBOL ptr
898 
899 declare function symbFindOpOvlProc _
900  ( _
901  byval op as AST_OP, _
902  byval parent as FBSYMBOL ptr, _
903  byval proc as FBSYMBOL ptr _
904  ) as FBSYMBOL ptr
905 
906 declare function symbFindClosestOvlProc _
907  ( _
908  byval proc as FBSYMBOL ptr, _
909  byval params as integer, _
910  byval arg_head as FB_CALL_ARG ptr, _
911  byval err_num as FB_ERRMSG ptr, _
913  ) as FBSYMBOL ptr
914 
915 declare function symbFindBopOvlProc _
916  ( _
917  byval op as AST_OP, _
918  byval l as ASTNODE ptr, _
919  byval r as ASTNODE ptr, _
920  byval err_num as FB_ERRMSG ptr _
921  ) as FBSYMBOL ptr
922 
923 declare function symbFindSelfBopOvlProc _
924  ( _
925  byval op as AST_OP, _
926  byval l as ASTNODE ptr, _
927  byval r as ASTNODE ptr, _
928  byval err_num as FB_ERRMSG ptr _
929  ) as FBSYMBOL ptr
930 
931 declare function symbFindUopOvlProc _
932  ( _
933  byval op as AST_OP, _
934  byval l as ASTNODE ptr, _
935  byval err_num as FB_ERRMSG ptr _
936  ) as FBSYMBOL ptr
937 
938 declare function symbFindSelfUopOvlProc _
939  ( _
940  byval op as AST_OP, _
941  byval l as ASTNODE ptr, _
942  byval err_num as FB_ERRMSG ptr _
943  ) as FBSYMBOL ptr
944 
945 declare function symbFindCastOvlProc _
946  ( _
947  byval to_dtype as integer, _
948  byval to_subtype as FBSYMBOL ptr, _
949  byval expr as ASTNODE ptr, _
950  byval err_num as FB_ERRMSG ptr _
951  ) as FBSYMBOL ptr
952 
953 declare function symbFindCtorOvlProc _
954  ( _
955  byval sym as FBSYMBOL ptr, _
956  byval expr as ASTNODE ptr, _
957  byval arg_mode as FB_PARAMMODE, _
958  byval err_num as FB_ERRMSG ptr _
959  ) as FBSYMBOL ptr
960 
961 declare function symbFindCtorProc _
962  ( _
963  byval head_proc as FBSYMBOL ptr, _
964  byval proc as FBSYMBOL ptr _
965  ) as FBSYMBOL ptr
966 
967 declare sub symbProcCheckOverridden _
968  ( _
969  byval proc as FBSYMBOL ptr, _
970  byval is_implicit as integer _
971  )
972 declare sub symbProcSetVtableIndex( byval proc as FBSYMBOL ptr, byval i as integer )
973 declare function symbProcGetVtableIndex( byval proc as FBSYMBOL ptr ) as integer
974 declare function symbProcGetOverridden( byval proc as FBSYMBOL ptr ) as FBSYMBOL ptr
975 declare function symbGetProcResult( byval proc as FBSYMBOL ptr ) as FBSYMBOL ptr
976 
977 declare function symbAreProcModesEqual _
978  ( _
979  byval proca as FBSYMBOL ptr, _
980  byval procb as FBSYMBOL ptr _
981  ) as integer
982 
983 declare function symbAddKeyword _
984  ( _
985  byval symbol as const zstring ptr, _
986  byval id as integer, _
987  byval class as integer, _
988  byval hashtb as FBHASHTB ptr = NULL, _
989  byval dtype as integer = FB_DATATYPE_INVALID, _
991  ) as FBSYMBOL ptr
992 
993 declare function symbKeywordGetText( byval tk as integer ) as const zstring ptr
994 
995 declare function symbAddDefine _
996  ( _
997  byval symbol as const zstring ptr, _
998  byval text as zstring ptr, _
999  byval lgt as integer, _
1000  byval isargless as integer = FALSE, _
1001  byval proc as FBS_DEFINE_PROC = NULL, _
1003  ) as FBSYMBOL ptr
1004 
1005 declare function symbAddDefineW _
1006  ( _
1007  byval symbol as zstring ptr, _
1008  byval text as wstring ptr, _
1009  byval lgt as integer, _
1010  byval isargless as integer = FALSE, _
1011  byval proc as FBS_DEFINE_PROC = NULL, _
1013  ) as FBSYMBOL ptr
1014 
1015 declare function symbAddDefineMacro _
1016  ( _
1017  byval symbol as const zstring ptr, _
1018  byval tokhead as FB_DEFTOK ptr, _
1019  byval params as integer, _
1020  byval paramhead as FB_DEFPARAM ptr, _
1022  ) as FBSYMBOL ptr
1023 
1024 declare function symbAddDefineParam _
1025  ( _
1026  byval lastparam as FB_DEFPARAM ptr, _
1027  byval symbol as const zstring ptr _
1028  ) as FB_DEFPARAM ptr
1029 
1030 declare function symbAddDefineTok _
1031  ( _
1032  byval lasttok as FB_DEFTOK ptr, _
1033  byval dtype as FB_DEFTOK_TYPE _
1034  ) as FB_DEFTOK ptr
1035 
1036 declare function symbDelDefineTok _
1037  ( _
1038  byval tok as FB_DEFTOK ptr _
1039  ) as FB_DEFTOK ptr
1040 
1041 declare function symbAddFwdRef _
1042  ( _
1043  byval id as zstring ptr _
1044  ) as FBSYMBOL ptr
1045 
1046 declare function symbAddTypedef _
1047  ( _
1048  byval id as zstring ptr, _
1049  byval dtype as integer, _
1050  byval subtype as FBSYMBOL ptr, _
1051  byval lgt as longint _
1052  ) as FBSYMBOL ptr
1053 
1054 declare function symbAddLabel _
1055  ( _
1056  byval symbol as zstring ptr, _
1058  ) as FBSYMBOL ptr
1059 
1060 declare function symbAddVar _
1061  ( _
1062  byval symbol as const zstring ptr, _
1063  byval aliasname as const zstring ptr, _
1064  byval dtype as integer, _
1065  byval subtype as FBSYMBOL ptr, _
1066  byval lgt as longint, _
1067  byval dimensions as integer, _
1068  dTB() as FBARRAYDIM, _
1069  byval attrib as integer, _
1070  byval options as FB_SYMBOPT = FB_SYMBOPT_NONE _
1071  ) as FBSYMBOL ptr
1072 
1073 declare function symbAddTempVar _
1074  ( _
1075  byval dtype as integer, _
1076  byval subtype as FBSYMBOL ptr = NULL _
1077  ) as FBSYMBOL ptr
1078 
1079 declare function symbAddImplicitVar _
1080  ( _
1081  byval dtype as integer, _
1082  byval subtype as FBSYMBOL ptr = NULL, _
1083  byval options as integer = 0 _
1084  ) as FBSYMBOL ptr
1085 
1086 declare function symbAddAndAllocateTempVar( byval dtype as integer ) as FBSYMBOL ptr
1087 
1088 declare function symbAddArrayDesc _
1089  ( _
1090  byval array as FBSYMBOL ptr, _
1091  byval dimensions as integer _
1092  ) as FBSYMBOL ptr
1093 
1094 declare function symbAddConst _
1095  ( _
1096  byval id as zstring ptr, _
1097  byval dtype as integer, _
1098  byval subtype as FBSYMBOL ptr, _
1099  byval value as FBVALUE ptr, _
1100  byval attrib as integer = FB_SYMBATTRIB_NONE _
1101  ) as FBSYMBOL ptr
1102 
1103 declare function symbGetConstValueAsStr( byval s as FBSYMBOL ptr ) as string
1104 
1105 declare function symbStructBegin _
1106  ( _
1107  byval symtb as FBSYMBOLTB ptr, _
1108  byval parent as FBSYMBOL ptr, _
1109  byval id as const zstring ptr, _
1110  byval id_alias as const zstring ptr, _
1111  byval isunion as integer, _
1112  byval align as integer, _
1113  byval base_ as FBSYMBOL ptr, _
1114  byval attrib as integer _
1115  ) as FBSYMBOL ptr
1116 
1117 declare function typeCalcNaturalAlign _
1118  ( _
1119  byval dtype as integer, _
1120  byval subtype as FBSYMBOL ptr _
1121  ) as integer
1122 
1123 declare function symbAddField _
1124  ( _
1125  byval parent as FBSYMBOL ptr, _
1126  byval id as zstring ptr, _
1127  byval dimensions as integer, _
1128  dTB() as FBARRAYDIM, _
1129  byval dtype as integer, _
1130  byval subtype as FBSYMBOL ptr, _
1131  byval lgt as longint, _
1132  byval bits as integer _
1133  ) as FBSYMBOL ptr
1134 
1135 declare sub symbInsertInnerUDT _
1136  ( _
1137  byval parent as FBSYMBOL ptr, _
1138  byval inner as FBSYMBOL ptr _
1139  )
1140 
1141 declare sub symbStructEnd _
1142  ( _
1143  byval t as FBSYMBOL ptr, _
1144  byval isnested as integer = FALSE _
1145  )
1146 
1147 declare function symbAddEnum _
1148  ( _
1149  byval id as zstring ptr, _
1150  byval id_alias as zstring ptr, _
1151  byval attrib as integer _
1152  ) as FBSYMBOL ptr
1153 
1154 declare function symbAddEnumElement _
1155  ( _
1156  byval parent as FBSYMBOL ptr, _
1157  byval id as zstring ptr, _
1158  byval value as longint, _
1159  byval attrib as integer _
1160  ) as FBSYMBOL ptr
1161 
1162 declare function symbAddProcParam _
1163  ( _
1164  byval proc as FBSYMBOL ptr, _
1165  byval id as zstring ptr, _
1166  byval dtype as integer, _
1167  byval subtype as FBSYMBOL ptr, _
1168  byval mode as integer, _
1169  byval attrib as FB_SYMBATTRIB _
1170  ) as FBSYMBOL ptr
1171 
1172 declare sub symbMakeParamOptional _
1173  ( _
1174  byval proc as FBSYMBOL ptr, _
1175  byval param as FBSYMBOL ptr, _
1176  byval optexpr as ASTNODE ptr _
1177  )
1178 
1179 declare function symbAddProc _
1180  ( _
1181  byval proc as FBSYMBOL ptr, _
1182  byval id as const zstring ptr, _
1183  byval id_alias as const zstring ptr, _
1184  byval dtype as integer, _
1185  byval subtype as FBSYMBOL ptr, _
1186  byval attrib as integer, _
1187  byval mode as integer, _
1188  byval options as FB_SYMBOPT _
1189  ) as FBSYMBOL ptr
1190 
1191 declare function symbAddOperator _
1192  ( _
1193  byval proc as FBSYMBOL ptr, _
1194  byval op as AST_OP, _
1195  byval id_alias as zstring ptr, _
1196  byval dtype as integer, _
1197  byval subtype as FBSYMBOL ptr, _
1198  byval attrib as integer, _
1199  byval mode as integer, _
1200  byval options as FB_SYMBOPT = FB_SYMBOPT_NONE _
1201  ) as FBSYMBOL ptr
1202 
1203 declare function symbAddCtor _
1204  ( _
1205  byval proc as FBSYMBOL ptr, _
1206  byval id_alias as zstring ptr, _
1207  byval attrib as integer, _
1208  byval mode as integer, _
1209  byval options as FB_SYMBOPT = FB_SYMBOPT_NONE _
1210  ) as FBSYMBOL ptr
1211 
1212 declare function symbAddProcPtr _
1213  ( _
1214  byval proc as FBSYMBOL ptr, _
1215  byval dtype as integer, _
1216  byval subtype as FBSYMBOL ptr, _
1217  byval attrib as integer, _
1218  byval mode as integer _
1219  ) as FBSYMBOL ptr
1220 
1221 declare function symbAddProcPtrFromFunction _
1222  ( _
1223  byval base_proc as FBSYMBOL ptr _
1224  ) as FBSYMBOL ptr
1225 
1226 declare function symbPreAddProc _
1227  ( _
1228  byval symbol as zstring ptr _
1229  ) as FBSYMBOL ptr
1230 
1231 declare sub symbGetRealParamDtype _
1232  ( _
1233  byval parammode as integer, _
1234  byref dtype as integer, _
1235  byref subtype as FBSYMBOL ptr _
1236  )
1237 
1238 declare function symbAddVarForParam( byval param as FBSYMBOL ptr ) as FBSYMBOL ptr
1239 declare function symbAddProcResultParam( byval proc as FBSYMBOL ptr ) as FBSYMBOL ptr
1240 declare function symbAddProcResult( byval f as FBSYMBOL ptr ) as FBSYMBOL ptr
1241 
1242 declare sub symbAddProcInstancePtr _
1243  ( _
1244  byval parent as FBSYMBOL ptr, _
1245  byval proc as FBSYMBOL ptr _
1246  )
1247 
1248 declare sub symbProcAllocExt( byval proc as FBSYMBOL ptr )
1249 declare sub symbProcFreeExt( byval proc as FBSYMBOL ptr )
1250 declare function symbProcReturnsOnStack( byval proc as FBSYMBOL ptr ) as integer
1251 
1252 declare function symbCalcArgLen _
1253  ( _
1254  byval dtype as integer, _
1255  byval subtype as FBSYMBOL ptr, _
1256  byval mode as integer _
1257  ) as longint
1258 
1259 declare function symbCalcParamLen _
1260  ( _
1261  byval dtype as integer, _
1262  byval subtype as FBSYMBOL ptr, _
1263  byval mode as FB_PARAMMODE _
1264  ) as longint
1265 
1266 declare function symbCalcProcParamsLen( byval proc as FBSYMBOL ptr ) as longint
1267 
1268 declare function symbAddScope _
1269  ( _
1270  byval backnode as ASTNODE ptr _
1271  ) as FBSYMBOL ptr
1272 
1273 declare function symbAddNamespace _
1274  ( _
1275  byval id as zstring ptr, _
1276  byval id_alias as zstring ptr _
1277  ) as FBSYMBOL ptr
1278 
1279 declare sub symbAddToFwdRef _
1280  ( _
1281  byval f as FBSYMBOL ptr, _
1282  byval ref as FBSYMBOL ptr _
1283  )
1284 
1285 declare sub symbRemoveFromFwdRef _
1286  ( _
1287  byval f as FBSYMBOL ptr, _
1288  byval ref as FBSYMBOL ptr _
1289  )
1290 
1291 declare sub symbRecalcUDTSize _
1292  ( _
1293  byval t as FBSYMBOL ptr _
1294  )
1295 
1296 declare sub symbSetArrayDimTb _
1297  ( _
1298  byval s as FBSYMBOL ptr, _
1299  byval dimensions as integer, _
1300  dTB() as FBARRAYDIM _
1301  )
1302 
1303 declare sub symbDelSymbolTb _
1304  ( _
1305  byval tb as FBSYMBOLTB ptr, _
1306  byval hashonly as integer _
1307  )
1308 
1309 declare sub symbDelScopeTb _
1310  ( _
1311  byval scp as FBSYMBOL ptr _
1312  )
1313 
1314 declare sub symbDelSymbol _
1315  ( _
1316  byval s as FBSYMBOL ptr, _
1317  byval is_tbdel as integer = FALSE _
1318  )
1319 
1320 declare function symbDelDefine _
1321  ( _
1322  byval s as FBSYMBOL ptr _
1323  ) as integer
1324 
1325 declare sub symbDelLabel _
1326  ( _
1327  byval s as FBSYMBOL ptr _
1328  )
1329 
1330 declare sub symbDelVarDims( byval s as FBSYMBOL ptr )
1331 declare sub symbDelVar( byval s as FBSYMBOL ptr, byval is_tbdel as integer )
1332 declare sub symbDelPrototype( byval s as FBSYMBOL ptr )
1333 declare sub symbDelEnum( byval s as FBSYMBOL ptr )
1334 declare sub symbDelStruct( byval s as FBSYMBOL ptr )
1335 declare sub symbDelField( byval s as FBSYMBOL ptr )
1336 
1337 declare sub symbDelConst _
1338  ( _
1339  byval s as FBSYMBOL ptr _
1340  )
1341 
1342 declare sub symbDelScope _
1343  ( _
1344  byval scp as FBSYMBOL ptr _
1345  )
1346 
1347 declare sub symbDelNamespaceMembers _
1348  ( _
1349  byval ns as FBSYMBOL ptr, _
1350  byval delete_hashtb as integer _
1351  )
1352 
1353 declare sub symbDelNamespace( byval ns as FBSYMBOL ptr )
1354 
1355 declare function symbNewSymbol _
1356  ( _
1357  byval options as FB_SYMBOPT, _
1358  byval s as FBSYMBOL ptr, _
1359  byval symtb as FBSYMBOLTB ptr, _
1360  byval hashtb as FBHASHTB ptr, _
1361  byval class as FB_SYMBCLASS, _
1362  byval id as const zstring ptr, _
1363  byval id_alias as const zstring ptr, _
1364  byval dtype as integer, _
1365  byval subtype as FBSYMBOL ptr, _
1367  ) as FBSYMBOL ptr
1368 
1369 declare sub symbFreeSymbol _
1370  ( _
1371  byval s as FBSYMBOL ptr _
1372  )
1373 
1374 declare sub symbFreeSymbol_RemOnly _
1375  ( _
1376  byval s as FBSYMBOL ptr _
1377  )
1378 
1379 declare sub symbFreeSymbol_UnlinkOnly _
1380  ( _
1381  byval s as FBSYMBOL ptr _
1382  )
1383 
1384 declare sub symbDelFromHash _
1385  ( _
1386  byval s as FBSYMBOL ptr _
1387  )
1388 
1389 declare sub symbDelFromChainList _
1390  ( _
1391  byval s as FBSYMBOL ptr _
1392  )
1393 
1394 declare sub symbAddArrayDim _
1395  ( _
1396  byval s as FBSYMBOL ptr, _
1397  byval lower as longint, _
1398  byval upper as longint _
1399  )
1400 
1401 declare sub symbRecalcLen( byval sym as FBSYMBOL ptr )
1402 declare sub symbSetType _
1403  ( _
1404  byval sym as FBSYMBOL ptr, _
1405  byval dtype as integer, _
1406  byval subtype as FBSYMBOL ptr _
1407  )
1408 
1409 declare function symbCalcLen _
1410  ( _
1411  byval dtype as integer, _
1412  byval subtype as FBSYMBOL ptr _
1413  ) as longint
1414 
1415 declare function symbCalcDerefLen _
1416  ( _
1417  byval dtype as integer, _
1418  byval subtype as FBSYMBOL ptr _
1419  ) as longint
1420 
1421 declare function symbAllocFloatConst _
1422  ( _
1423  byval value as double, _
1424  byval dtype as integer _
1425  ) as FBSYMBOL ptr
1426 
1427 
1428 declare function symbAllocIntConst _
1429  ( _
1430  byval value as integer, _
1431  byval dtype as integer _
1432  ) as FBSYMBOL ptr
1433 
1434 declare function symbAllocLongIntConst _
1435  ( _
1436  byval value as longint, _
1437  byval dtype as integer _
1438  ) as FBSYMBOL ptr
1439 
1440 
1441 declare function symbAllocStrConst _
1442  ( _
1443  byval sname as zstring ptr, _
1444  byval lgt as integer _
1445  ) as FBSYMBOL ptr
1446 
1447 declare function symbAllocWstrConst _
1448  ( _
1449  byval sname as wstring ptr, _
1450  byval lgt as integer _
1451  ) as FBSYMBOL ptr
1452 
1453 declare function symbCalcArrayElements overload _
1454  ( _
1455  byval s as FBSYMBOL ptr, _
1456  byval n as FBVARDIM ptr = NULL _
1457  ) as longint
1458 
1459 declare function symbCalcArrayElements _
1460  ( _
1461  byval dimensions as integer, _
1462  dTB() as FBARRAYDIM _
1463  ) as longint
1464 
1465 declare function symbCalcArrayDiff _
1466  ( _
1467  byval dimensions as integer, _
1468  dTB() as FBARRAYDIM, _
1469  byval lgt as longint _
1470  ) as longint
1471 
1472 declare function symbCheckArraySize _
1473  ( _
1474  byval dimensions as integer, _
1475  dTB() as FBARRAYDIM, _
1476  byval lgt as longint, _
1477  byval is_on_stack as integer, _
1478  byval allow_ellipsis as integer _
1479  ) as integer
1480 
1481 declare function symbCheckLabels _
1482  ( _
1483  byval symtbhead as FBSYMBOL ptr _
1484  ) as integer
1485 
1486 declare function symbCheckBitField _
1487  ( _
1488  byval udt as FBSYMBOL ptr, _
1489  byval dtype as integer, _
1490  byval lgt as longint, _
1491  byval bits as integer _
1492  ) as integer
1493 
1494 declare sub symbCheckFwdRef _
1495  ( _
1496  byval s as FBSYMBOL ptr _
1497  )
1498 
1499 declare function symbIsEqual _
1500  ( _
1501  byval sym1 as FBSYMBOL ptr, _
1502  byval sym2 as FBSYMBOL ptr _
1503  ) as integer
1504 
1505 declare function symbIsProcOverloadOf _
1506  ( _
1507  byval proc as FBSYMBOL ptr, _
1508  byval parent as FBSYMBOL ptr _
1509  ) as integer
1510 
1511 declare function symbHasCtor( byval sym as FBSYMBOL ptr ) as integer
1512 declare function symbHasDefCtor( byval sym as FBSYMBOL ptr ) as integer
1513 declare function symbHasDtor( byval sym as FBSYMBOL ptr ) as integer
1514 
1515 declare function symbIsArray _
1516  ( _
1517  byval sym as FBSYMBOL ptr _
1518  ) as integer
1519 
1520 declare function symbIsString _
1521  ( _
1522  byval dtype as integer _
1523  ) as integer
1524 
1525 declare function symbGetVarHasCtor _
1526  ( _
1527  byval s as FBSYMBOL ptr _
1528  ) as integer
1529 
1530 declare function symbGetVarHasDtor _
1531  ( _
1532  byval s as FBSYMBOL ptr _
1533  ) as integer
1534 
1535 declare sub typeMax _
1536  ( _
1537  byval ldtype as integer, _
1538  byval lsubtype as FBSYMBOL ptr, _
1539  byval rdtype as integer, _
1540  byval rsubtype as FBSYMBOL ptr, _
1541  byref dtype as integer, _
1542  byref subtype as FBSYMBOL ptr _
1543  )
1544 
1545 declare function typeToSigned _
1546  ( _
1547  byval dtype as integer _
1548  ) as integer
1549 
1550 declare function typeToUnsigned _
1551  ( _
1552  byval dtype as integer _
1553  ) as integer
1554 
1555 declare function typeRemap _
1556  ( _
1557  byval dtype as integer, _
1558  byval subtype as FBSYMBOL ptr _
1559  ) as integer
1560 
1561 declare function typeHasCtor _
1562  ( _
1563  byval dtype as integer, _
1564  byval subtype as FBSYMBOL ptr _
1565  ) as integer
1566 
1567 declare function typeHasDefCtor _
1568  ( _
1569  byval dtype as integer, _
1570  byval subtype as FBSYMBOL ptr _
1571  ) as integer
1572 
1573 declare function typeHasDtor _
1574  ( _
1575  byval dtype as integer, _
1576  byval subtype as FBSYMBOL ptr _
1577  ) as integer
1578 
1579 declare function typeMerge _
1580  ( _
1581  byval dtype1 as integer, _
1582  byval dtype2 as integer _
1583  ) as integer
1584 
1585 declare sub symbHashListAdd _
1586  ( _
1587  byval hashtb as FBHASHTB ptr _
1588  )
1589 
1590 declare sub symbHashListAddBefore _
1591  ( _
1592  byval lasttb as FBHASHTB ptr, _
1593  byval hashtb as FBHASHTB ptr _
1594  )
1595 
1596 declare sub symbHashListDel _
1597  ( _
1598  byval hashtb as FBHASHTB ptr _
1599  )
1600 
1601 declare function symbNamespaceImport _
1602  ( _
1603  byval ns as FBSYMBOL ptr _
1604  ) as integer
1605 
1606 declare function symbNamespaceImportEx _
1607  ( _
1608  byval ns as FBSYMBOL ptr, _
1609  byval to_ns as FBSYMBOL ptr _
1610  ) as integer
1611 
1612 declare sub symbNamespaceRemove _
1613  ( _
1614  byval sym as FBSYMBOL ptr, _
1615  byval hashonly as integer _
1616  )
1617 
1618 declare sub symbNamespaceReImport _
1619  ( _
1620  byval ns as FBSYMBOL ptr _
1621  )
1622 
1623 declare sub symbNestBegin _
1624  ( _
1625  byval sym as FBSYMBOL ptr, _
1626  byval insert_chain as integer = FALSE _
1627  )
1628 
1629 declare sub symbNestEnd _
1630  ( _
1631  byval remove_chain as integer = FALSE _
1632  )
1633 
1634 declare function symbCanDuplicate _
1635  ( _
1636  byval head_sym as FBSYMBOL ptr, _
1637  byval s as FBSYMBOL ptr _
1638  ) as integer
1639 
1640 declare function symbUniqueId( ) as zstring ptr
1641 declare function symbUniqueLabel( ) as zstring ptr
1642 declare function symbMakeProfileLabelName( ) as zstring ptr
1643 declare function symbGetMangledName( byval sym as FBSYMBOL ptr ) as zstring ptr
1644 declare function symbGetDBGName( byval sym as FBSYMBOL ptr ) as zstring ptr
1645 declare sub symbSetName( byval s as FBSYMBOL ptr, byval name_ as zstring ptr )
1646 declare sub symbMangleInitAbbrev( )
1647 declare sub symbMangleEndAbbrev( )
1648 declare sub symbMangleType _
1649  ( _
1650  byref mangled as string, _
1651  byval dtype as integer, _
1652  byval subtype as FBSYMBOL ptr _
1653  )
1654 declare sub symbMangleParam( byref mangled as string, byval param as FBSYMBOL ptr )
1655 
1656 declare function symbProcPtrToStr( byval proc as FBSYMBOL ptr ) as string
1657 declare function symbMethodToStr( byval proc as FBSYMBOL ptr ) as string
1658 
1659 declare function symbTypeToStr _
1660  ( _
1661  byval dtype as integer, _
1662  byval subtype as FBSYMBOL ptr, _
1663  byval lgt as longint = 0 _
1664  ) as string
1665 
1666 declare function symbGetDefType _
1667  ( _
1668  byval symbol as const zstring ptr _
1669  ) as integer
1670 
1671 declare sub symbSetDefType _
1672  ( _
1673  byval ichar as integer, _
1674  byval echar as integer, _
1675  byval typ as integer _
1676  )
1677 
1678 declare sub symbUdtAllocExt( byval udt as FBSYMBOL ptr )
1679 declare sub symbUdtAddDefaultMembers( byval sym as FBSYMBOL ptr )
1680 declare function symbCompIsTrivial( byval sym as FBSYMBOL ptr ) as integer
1681 declare sub symbSetCompCtorHead( byval sym as FBSYMBOL ptr, byval proc as FBSYMBOL ptr )
1682 declare sub symbCheckCompCtor( byval sym as FBSYMBOL ptr, byval proc as FBSYMBOL ptr )
1683 declare sub symbSetCompDtor( byval sym as FBSYMBOL ptr, byval proc as FBSYMBOL ptr )
1684 declare function symbGetCompCtorHead( byval sym as FBSYMBOL ptr ) as FBSYMBOL ptr
1685 declare function symbGetCompDefCtor( byval sym as FBSYMBOL ptr ) as FBSYMBOL ptr
1686 declare function symbGetCompCopyCtor( byval sym as FBSYMBOL ptr ) as FBSYMBOL ptr
1687 declare function symbGetCompDtor( byval sym as FBSYMBOL ptr ) as FBSYMBOL ptr
1688 declare sub symbCheckCompClone( byval sym as FBSYMBOL ptr, byval proc as FBSYMBOL ptr )
1689 declare function symbGetCompCloneProc( byval sym as FBSYMBOL ptr ) as FBSYMBOL ptr
1690 
1691 declare function symbGetCompOpOvlHead _
1692  ( _
1693  byval sym as FBSYMBOL ptr, _
1694  byval op as AST_OP _
1695  ) as FBSYMBOL ptr
1696 
1697 declare sub symbSetCompOpOvlHead _
1698  ( _
1699  byval syn as FBSYMBOL ptr, _
1700  byval proc as FBSYMBOL ptr _
1701  )
1702 
1703 declare function symbCompAddVirtual( byval udt as FBSYMBOL ptr ) as integer
1704 declare function symbCompGetAbstractCount( byval udt as FBSYMBOL ptr ) as integer
1705 declare function symbAddGlobalCtor( byval proc as FBSYMBOL ptr ) as FB_GLOBCTORLIST_ITEM ptr
1706 declare function symbAddGlobalDtor( byval proc as FBSYMBOL ptr ) as FB_GLOBCTORLIST_ITEM ptr
1707 
1708 declare function symbCloneSymbol _
1709  ( _
1710  byval s as FBSYMBOL ptr _
1711  ) as FBSYMBOL ptr
1712 
1713 declare function symbCloneConst( byval sym as FBSYMBOL ptr ) as FBSYMBOL ptr
1714 declare function symbCloneVar( byval sym as FBSYMBOL ptr ) as FBSYMBOL ptr
1715 declare function symbCloneStruct( byval sym as FBSYMBOL ptr ) as FBSYMBOL ptr
1716 
1717 declare function symbCloneLabel _
1718  ( _
1719  byval sym as FBSYMBOL ptr _
1720  ) as FBSYMBOL ptr
1721 
1722 declare function symbCheckAccess( byval sym as FBSYMBOL ptr ) as integer
1723 
1724 declare function symbGetFullProcName _
1725  ( _
1726  byval proc as FBSYMBOL ptr _
1727  ) as zstring ptr
1728 
1729 declare function symbUdtGetFirstField( byval parent as FBSYMBOL ptr ) as FBSYMBOL ptr
1730 declare function symbUdtGetNextField( byval sym as FBSYMBOL ptr ) as FBSYMBOL ptr
1731 declare function symbUdtGetNextInitableField( byval sym as FBSYMBOL ptr ) as FBSYMBOL ptr
1732 
1733 declare function symbGetEnumFirstElm _
1734  ( _
1735  byval parent as FBSYMBOL ptr _
1736  ) as FBSYMBOL ptr
1737 
1738 declare function symbGetEnumNextElm _
1739  ( _
1740  byval sym as FBSYMBOL ptr _
1741  ) as FBSYMBOL ptr
1742 
1743 declare sub symbCompDelImportList _
1744  ( _
1745  byval sym as FBSYMBOL ptr _
1746  )
1747 
1748 declare sub symbHashListInsertNamespace _
1749  ( _
1750  byval ns as FBSYMBOL ptr, _
1751  byval src_head as FBSYMBOL ptr _
1752  )
1753 
1754 declare sub symbHashListRemoveNamespace _
1755  ( _
1756  byval ns as FBSYMBOL ptr _
1757  )
1758 
1759 declare function symbGetDefaultCallConv _
1760  ( _
1761  byval dtype as integer, _
1762  byval subtype as FBSYMBOL ptr _
1763  ) as integer
1764 
1765 declare function symbVarCheckAccess( byval sym as FBSYMBOL ptr ) as integer
1766 
1767 declare function symbCheckConstAssign _
1768  ( _
1769  byval ldtype as FB_DATATYPE, _
1770  byval rdtype as FB_DATATYPE, _
1771  byval lsubtype as FBSYMBOL ptr, _
1772  byval rsubtype as FBSYMBOL ptr, _
1773  byval mode as FB_PARAMMODE = 0, _
1774  byref misses as integer = 0 _
1775  ) as integer
1776 
1777 declare function symbAllocOvlCallArg _
1778  ( _
1779  byval list as TLIST ptr, _
1780  byval arg_list as FB_CALL_ARG_LIST ptr, _
1781  byval to_head as integer = FALSE _
1782  ) as FB_CALL_ARG ptr
1783 
1784 #define symbFreeOvlCallArg( list, arg ) listDelNode( list, arg )
1785 
1786 declare sub symbFreeOvlCallArgs _
1787  ( _
1788  byval list as TLIST ptr, _
1789  byval arg_list as FB_CALL_ARG_LIST ptr _
1790  )
1791 
1792 declare function symbGetUDTBaseLevel _
1793  ( _
1794  byval s as FBSYMBOL ptr, _
1795  byval baseSym as FBSYMBOL ptr _
1796  ) as integer
1797 
1798 
1799 ''
1800 '' macros
1801 ''
1802 
1803 #macro symbHashTbInit( _hashtb, _owner, _nodes )
1804  _hashtb.owner = _owner
1805  _hashtb.prev = NULL
1806  _hashtb.next = NULL
1807  hashInit( @_hashtb.tb, _nodes )
1808 #endmacro
1809 
1810 #macro symbSymbTbInit( _symtb, _owner )
1811  _symtb.owner = _owner
1812  _symtb.head = NULL
1813  _symtb.tail = NULL
1814 #endmacro
1815 
1816 #macro symbHashListMove( hashtb )
1819 #endmacro
1820 
1821 #macro symbHashListMoveBefore( lasttb, hashtb )
1823  symbHashListAddBefore( lasttb, hashtb )
1824 #endmacro
1825 
1826 #define symbGetGlobalNamespc( ) symb.globnspc
1827 
1828 #define symbIsGlobalNamespc( ) (symb.namespc = @symbGetGlobalNamespc( ))
1829 
1830 #define symbGetGlobalTb( ) symbGetGlobalNamespc( ).nspc.ns.symtb
1831 
1832 #define symbGetGlobalTbHead( ) symbGetGlobalTb( ).head
1833 
1834 #define symbGetGlobalHashTb( ) symbGetGlobalNamespc( ).nspc.ns.hashtb
1835 
1836 #define symbGetCurrentNamespc( ) symb.namespc
1837 #define symbSetCurrentNamespc(ns) symb.namespc = ns
1838 
1839 #define symbGetCurrentSymTb( ) symb.symtb
1840 #define symbSetCurrentSymTb(tb) symb.symtb = tb
1841 
1842 #define symbGetCurrentHashTb( ) symb.hashtb
1843 #define symbSetCurrentHashTb(tb) symb.hashtb = tb
1844 
1845 #define symbGetGlobCtorListHead( ) symb.globctorlist.head
1846 
1847 #define symbGetGlobDtorListHead( ) symb.globdtorlist.head
1848 
1849 #define symbGetIsAccessed(s) ((s->stats and FB_SYMBSTATS_ACCESSED) <> 0)
1850 #define symbSetIsAccessed(s) s->stats or= FB_SYMBSTATS_ACCESSED
1851 
1852 #define symbGetVarIsAllocated(s) ((s->stats and FB_SYMBSTATS_VARALLOCATED) <> 0)
1853 #define symbSetVarIsAllocated(s) s->stats or= FB_SYMBSTATS_VARALLOCATED
1854 
1855 #define symbGetIsInitialized(s) ((s->stats and FB_SYMBSTATS_INITIALIZED) <> 0)
1856 #define symbSetIsInitialized(s) s->stats or= FB_SYMBSTATS_INITIALIZED
1857 
1858 #define symbGetIsDeclared(s) ((s->stats and FB_SYMBSTATS_DECLARED) <> 0)
1859 #define symbSetIsDeclared(s) s->stats or= FB_SYMBSTATS_DECLARED
1860 
1861 #define symbGetIsImplicit( s ) (((s)->stats and FB_SYMBSTATS_IMPLICIT) <> 0)
1862 #define symbSetIsImplicit( s ) (s)->stats or= FB_SYMBSTATS_IMPLICIT
1863 
1864 #define symbGetIsRTL(s) ((s->stats and FB_SYMBSTATS_RTL) <> 0)
1865 
1866 #define symbGetIsThrowable(s) ((s->stats and FB_SYMBSTATS_THROWABLE) <> 0)
1867 #define symbSetIsThrowable(s) s->stats or= FB_SYMBSTATS_THROWABLE
1868 
1869 #define symbGetIsParsed(s) ((s->stats and FB_SYMBSTATS_PARSED) <> 0)
1870 #define symbSetIsParsed(s) s->stats or= FB_SYMBSTATS_PARSED
1871 
1872 #define symbSetDontInit(s) s->stats or= FB_SYMBSTATS_DONTINIT
1873 #define symbGetDontInit(s) ((s->stats and FB_SYMBSTATS_DONTINIT) <> 0)
1874 
1875 #define symbGetIsMainProc(s) ((s->stats and FB_SYMBSTATS_MAINPROC) <> 0)
1876 #define symbSetIsMainProc(s) s->stats or= FB_SYMBSTATS_MAINPROC
1877 
1878 #define symbGetIsModLevelProc(s) ((s->stats and FB_SYMBSTATS_MODLEVELPROC) <> 0)
1879 #define symbSetIsModLevelProc(s) s->stats or= FB_SYMBSTATS_MODLEVELPROC
1880 
1881 #define symbGetIsFuncPtr(s) ((s->stats and FB_SYMBSTATS_FUNCPTR) <> 0)
1882 #define symbSetIsFuncPtr(s) s->stats or= FB_SYMBSTATS_FUNCPTR
1883 
1884 #define symbGetIsJumpTb(s) ((s->stats and FB_SYMBSTATS_JUMPTB) <> 0)
1885 #define symbSetIsJumpTb(s) s->stats or= FB_SYMBSTATS_JUMPTB
1886 
1887 #define symbGetIsUnique(s) ((s->stats and FB_SYMBSTATS_CANTDUP) <> 0)
1888 #define symbSetIsUnique(s) s->stats or= FB_SYMBSTATS_CANTDUP
1889 
1890 #define symbGetHasRTTI(s) ((s->stats and FB_SYMBSTATS_HASRTTI) <> 0)
1891 #define symbSetHasRTTI(s) s->stats or= FB_SYMBSTATS_HASRTTI
1892 
1893 #define symbGetIsGlobalCtor(s) ((s->stats and FB_SYMBSTATS_GLOBALCTOR) <> 0)
1894 #define symbSetIsGlobalCtor( s ) s->stats or= FB_SYMBSTATS_GLOBALCTOR or FB_SYMBSTATS_ACCESSED
1895 
1896 #define symbGetIsGlobalDtor(s) ((s->stats and FB_SYMBSTATS_GLOBALDTOR) <> 0)
1897 #define symbSetIsGlobalDtor( s ) s->stats or= FB_SYMBSTATS_GLOBALDTOR or FB_SYMBSTATS_ACCESSED
1898 
1899 #define symbGetIsCtorInited(s) ((s->stats and FB_SYMBSTATS_CTORINITED) <> 0)
1900 #define symbSetIsCtorInited(s) s->stats or= FB_SYMBSTATS_CTORINITED
1901 
1902 #define symbGetCantUndef(s) ((s->stats and FB_SYMBSTATS_CANTUNDEF) <> 0)
1903 #define symbSetCantUndef(s) s->stats or= FB_SYMBSTATS_CANTUNDEF
1904 
1905 #define symbGetIsUnionField(s) ((s->stats and FB_SYMBSTATS_UNIONFIELD) <> 0)
1906 #define symbSetIsUnionField(s) s->stats or= FB_SYMBSTATS_UNIONFIELD
1907 
1908 #define symbGetIsRTLConst(s) ((s->stats and FB_SYMBSTATS_RTL_CONST) <> 0)
1909 #define symbSetIsRTLConst(s) s->stats or= FB_SYMBSTATS_RTL_CONST
1910 
1911 #define symbGetIsEmitted(s) ((s->stats and FB_SYMBSTATS_EMITTED) <> 0)
1912 #define symbSetIsEmitted(s) s->stats or= FB_SYMBSTATS_EMITTED
1913 
1914 #define symbGetIsBeingEmitted(s) ((s->stats and FB_SYMBSTATS_BEINGEMITTED) <> 0)
1915 #define symbSetIsBeingEmitted(s) s->stats or= FB_SYMBSTATS_BEINGEMITTED
1916 #define symbResetIsBeingEmitted(s) s->stats and= not FB_SYMBSTATS_BEINGEMITTED
1917 
1918 #define symbGetProcIsEmitted(s) ((s->stats and FB_SYMBSTATS_PROCEMITTED) <> 0)
1919 #define symbSetProcIsEmitted(s) s->stats or= FB_SYMBSTATS_PROCEMITTED
1920 
1921 #define symbGetIsIrHlcBuiltin(s) ((s->stats and FB_SYMBSTATS_IRHLCBUILTIN) <> 0)
1922 #define symbSetIsIrHlcBuiltin(s) s->stats or= FB_SYMBSTATS_IRHLCBUILTIN
1923 
1924 #define symbGetIsGccBuiltin(s) ((s->stats and FB_SYMBSTATS_GCCBUILTIN) <> 0)
1925 #define symbSetIsGccBuiltin(s) s->stats or= FB_SYMBSTATS_GCCBUILTIN
1926 
1927 #define symbGetIsWstring(s) (((s)->stats and FB_SYMBSTATS_WSTRING) <> 0)
1928 #define symbSetIsWstring(s) (s)->stats or= FB_SYMBSTATS_WSTRING
1929 
1930 #define symbGetStats(s) s->stats
1931 
1932 #define symbGetLen( s ) (s)->lgt
1933 
1934 #define symbGetStrLen(s) symbGetLen(s)
1935 
1936 #define symbGetWstrLen(s) ((s)->lgt \ typeGetSize( FB_DATATYPE_WCHAR ))
1937 
1938 #define symbGetFullType(s) s->typ
1939 #define symbGetType(s) typeGetDtAndPtrOnly( symbGetFullType( s ) )
1940 
1941 #define symbGetSubType(s) s->subtype
1942 
1943 #define symbGetPtrCnt(s) typeGetPtrCnt( symbGetType( s ) )
1944 
1945 #define symbGetClass(s) s->class
1946 
1947 #define symbGetSymbtb(s) s->symtb
1948 
1949 #define symbGetHashtb(s) s->hash.tb
1950 
1951 #define symbGetParent(s) symbGetSymbtb(s)->owner
1952 
1953 #define symbGetNamespace(s) symbGetHashtb(s)->owner
1954 
1955 #define symbGetMangling(s) s->mangling
1956 
1957 #define symbGetName(s) s->id.name
1958 
1959 #define symbGetOfs(s) s->ofs
1960 
1961 #define symbGetAttrib(s) s->attrib
1962 #define symbSetAttrib(s,t) s->attrib = t
1963 
1964 #define symbGetPrev(s) s->prev
1965 
1966 #define symbGetNext(s) s->next
1967 
1968 #define symbChainGetNext(c) c->next
1969 
1970 #define symbIsVar(s) (s->class = FB_SYMBCLASS_VAR)
1971 
1972 #define symbIsConst(s) (s->class = FB_SYMBCLASS_CONST)
1973 
1974 #define symbIsProc(s) (s->class = FB_SYMBCLASS_PROC)
1975 
1976 #define symbIsDefine(s) (s->class = FB_SYMBCLASS_DEFINE)
1977 
1978 #define symbIsKeyword(s) (s->class = FB_SYMBCLASS_KEYWORD)
1979 
1980 #define symbIsLabel(s) (s->class = FB_SYMBCLASS_LABEL)
1981 
1982 #define symbIsEnum(s) (s->class = FB_SYMBCLASS_ENUM)
1983 
1984 #define symbIsStruct(s) (s->class = FB_SYMBCLASS_STRUCT)
1985 
1986 #define symbIsField(s) (s->class = FB_SYMBCLASS_FIELD)
1987 
1988 #define symbIsBitfield( s ) ((s)->class = FB_SYMBCLASS_BITFIELD)
1989 
1990 #define symbIsTypedef(s) (s->class = FB_SYMBCLASS_TYPEDEF)
1991 
1992 #define symbIsFwdRef(s) (s->class = FB_SYMBCLASS_FWDREF)
1993 
1994 #define symbIsScope(s) (s->class = FB_SYMBCLASS_SCOPE)
1995 
1996 #define symbIsNameSpace(s) (s->class = FB_SYMBCLASS_NAMESPACE)
1997 
1998 #define symbGetConstVal( sym ) (@((sym)->val))
1999 #define symbGetConstStr( sym ) ((sym)->val.s)
2000 #define symbGetConstInt( sym ) ((sym)->val.i)
2001 #define symbGetConstFloat( sym ) ((sym)->val.f)
2002 
2003 #define symbGetDefineText(d) d->def.text
2004 
2005 #define symbGetDefineTextW(d) d->def.textw
2006 
2007 #define symbGetDefineHeadToken(d) d->def.tokhead
2008 
2009 #define symbGetDefTokPrev(t) t->prev
2010 
2011 #define symbGetDefTokNext(t) t->next
2012 
2013 #define symbGetDefTokType(t) t->type
2014 #define symbSetDefTokType(t,_typ) t->type = _typ
2015 
2016 #define symbGetDefTokText(t) t->text
2017 
2018 #define symbGetDefTokTextW(t) t->textw
2019 
2020 #define symbGetDefTokParamNum(t) t->paramnum
2021 #define symbSetDefTokParamNum(t,n) t->paramnum = n
2022 
2023 #define symbGetDefineParams(d) d->def.params
2024 
2025 #define symbGetDefineHeadParam(d) d->def.paramhead
2026 
2027 #define symbGetDefParamNext(a) a->next
2028 
2029 #define symbGetDefParamName(a) a->name
2030 
2031 #define symbGetDefParamNum(a) a->num
2032 
2033 #define symbGetDefineCallback(d) d->def.proc
2034 
2035 #define symbGetDefineIsArgless(d) d->def.isargless
2036 
2037 #define symbGetDefineFlags(d) d->def.flags
2038 
2039 #define symbGetVarLitText(s) s->var_.littext
2040 
2041 #define symbGetVarLitTextW(s) s->var_.littextw
2042 
2043 #define symbGetVarStmt(s) s->var_.stmtnum
2044 
2045 #define symbSetTypeIniTree(s, t) s->var_.initree = t
2046 #define symbGetTypeIniTree(s) s->var_.initree
2047 
2048 #define symbGetArrayDiff(s) s->var_.array.dif
2049 
2050 #define symbGetArrayDimensions(s) s->var_.array.dims
2051 #define symbSetArrayDimensions(s,d) s->var_.array.dims = d
2052 
2053 #define symbGetArrayDescriptor(s) s->var_.array.desc
2054 
2055 #define symbGetArrayOffset(s) s->var_.array.dif
2056 
2057 #define symbGetArrayFirstDim(s) s->var_.array.dimhead
2058 
2059 #define symbGetArrayElements(s) s->var_.array.elms
2060 
2061 #define symbGetUDTSymbTbHead(s) s->udt.ns.symtb.head
2062 
2063 #define symbGetUDTElmBitOfs(e) ( e->ofs * 8 + _
2064  iif( e->typ = FB_DATATYPE_BITFIELD, _
2065  e->subtype->bitfld.bitpos, _
2066  0) )
2067 
2068 #define symbGetUDTElmBitLen(e) iif( e->typ = FB_DATATYPE_BITFIELD, _
2069  clngint( e->subtype->bitfld.bits ), _ '' clngint needed for older versions of fbc
2070  e->lgt * e->var_.array.elms * 8 )
2071 
2072 #define symbSetUDTIsUnion(s) (s)->udt.options or= FB_UDTOPT_ISUNION
2073 #define symbGetUDTIsUnion(s) ((s->udt.options and FB_UDTOPT_ISUNION) <> 0)
2074 
2075 #define symbSetUDTHasPtrField(s) s->udt.options or= FB_UDTOPT_HASPTRFIELD
2076 #define symbGetUDTHasPtrField(s) ((s->udt.options and FB_UDTOPT_HASPTRFIELD) <> 0)
2077 
2078 #define symbSetUDTHasCtorField(s) s->udt.options or= FB_UDTOPT_HASCTORFIELD
2079 #define symbGetUDTHasCtorField(s) ((s->udt.options and FB_UDTOPT_HASCTORFIELD) <> 0)
2080 
2081 #define symbSetUDTHasDtorField(s) s->udt.options or= FB_UDTOPT_HASDTORFIELD
2082 #define symbGetUDTHasDtorField(s) ((s->udt.options and FB_UDTOPT_HASDTORFIELD) <> 0)
2083 
2084 #define symbSetUDTIsAnon(s) (s)->udt.options or= FB_UDTOPT_ISANON
2085 #define symbGetUDTIsAnon(s) ((s->udt.options and FB_UDTOPT_ISANON) <> 0)
2086 
2087 #define symbGetUDTHasRecByvalParam(s) ((s->udt.options and FB_UDTOPT_HASRECBYVALPARAM) <> 0)
2088 #define symbSetUDTHasRecByvalParam(s) s->udt.options or= FB_UDTOPT_HASRECBYVALPARAM
2089 
2090 #define symbGetUDTHasRecByvalRes(s) ((s->udt.options and FB_UDTOPT_HASRECBYVALRES) <> 0)
2091 #define symbSetUDTHasRecByvalRes(s) s->udt.options or= FB_UDTOPT_HASRECBYVALRES
2092 
2093 #define symbGetUDTHasGetProp(s) ((s->udt.options and FB_UDTOPT_HASGETPROPERTY) <> 0)
2094 #define symbSetUDTHasGetProp(s) s->udt.options or= FB_UDTOPT_HASGETPROPERTY
2095 
2096 #define symbGetUDTHasSetProp(s) ((s->udt.options and FB_UDTOPT_HASSETPROPERTY) <> 0)
2097 #define symbSetUDTHasSetProp(s) s->udt.options or= FB_UDTOPT_HASSETPROPERTY
2098 
2099 #define symbGetUDTHasIdxGetProp(s) ((s->udt.options and FB_UDTOPT_HASIDXGETPROPERTY) <> 0)
2100 #define symbSetUDTHasIdxGetProp(s) s->udt.options or= FB_UDTOPT_HASIDXGETPROPERTY
2101 
2102 #define symbGetUDTHasIdxSetProp(s) ((s->udt.options and FB_UDTOPT_HASIDXSETPROPERTY) <> 0)
2103 #define symbSetUDTHasIdxSetProp(s) s->udt.options or= FB_UDTOPT_HASIDXSETPROPERTY
2104 
2105 #define symbGetUDTHasKwdField(s) ((s->udt.options and FB_UDTOPT_HASKWDFIELD) <> 0)
2106 #define symbSetUDTHasKwdField(s) s->udt.options or= FB_UDTOPT_HASKWDFIELD
2107 
2108 #define symbSetUDTHasInitedField( s ) (s)->udt.options or= FB_UDTOPT_HASINITEDFIELD
2109 #define symbGetUDTHasInitedField( s ) (((s)->udt.options and FB_UDTOPT_HASINITEDFIELD) <> 0)
2110 
2111 #define symbSetUDTHasAnonUnion( s ) (s)->udt.options or= FB_UDTOPT_HASANONUNION
2112 #define symbGetUDTHasAnonUnion( s ) ((s->udt.options and FB_UDTOPT_HASANONUNION) <> 0)
2113 
2114 #define symbSetUdtHasStaticVar( s ) (s)->udt.options or= FB_UDTOPT_HASSTATICVAR
2115 #define symbGetUdtHasStaticVar( s ) (((s)->udt.options and FB_UDTOPT_HASSTATICVAR) <> 0)
2116 
2117 #define symbGetUDTIsUnionOrAnon(s) (((s)->udt.options and (FB_UDTOPT_ISUNION or FB_UDTOPT_ISANON)) <> 0)
2118 
2119 #define symbGetUDTAlign(s) s->udt.align
2120 
2121 #define symbGetUDTUnpadLen(s) s->udt.unpadlgt
2122 
2123 #define symbGetUDTSymbTb(s) s->udt.ns.symtb
2124 
2125 #define symbGetUDTHashTb(s) s->udt.ns.hashtb
2126 
2127 #define symbGetUDTAnonParent(s) s->udt.anonparent
2128 
2129 #define symbGetUDTRetType(s) s->udt.retdtype
2130 
2131 #define symbGetUDTOpOvlTb(s) s->udt.ext->opovlTb
2132 
2133 #define symbGetEnumSymbTbHead(s) s->enum_.ns.symtb.head
2134 #define symbGetEnumElements(s) s->enum_.elements
2135 
2136 #define symbGetScope(s) s->scope
2137 
2138 #define symbGetScopeSymbTb(s) s->scp.symtb
2139 
2140 #define symbGetScopeSymbTbHead(s) s->scp.symtb.head
2141 
2142 #define symbGetNamespaceSymbTb(s) s->nspc.ns.symtb
2143 
2144 #define symbGetNamespaceTbHead(s) s->nspc.ns.symtb.head
2145 
2146 #define symbGetNamespaceTbTail(s) s->nspc.ns.symtb.tail
2147 
2148 #define symbGetNamespaceHashTb(s) s->nspc.ns.hashtb
2149 
2150 #define symbGetNamespaceCnt(s) s->nspc.cnt
2151 
2152 #define symbGetNamespaceLastTail(s) s->nspc.last_tail
2153 
2154 #define symbGetLabelIsDeclared(l) l->lbl.declared
2155 #define symbSetLabelIsDeclared(l) l->lbl.declared = TRUE
2156 
2157 #define symbGetLabelParent(l) l->lbl.parent
2158 
2159 #define symbGetLabelStmt(s) s->lbl.stmtnum
2160 
2161 #define symbGetProcParams(f) f->proc.params
2162 
2163 #define symbGetProcOptParams(f) f->proc.optparams
2164 
2165 #define symbGetProcMode(f) f->proc.mode
2166 
2167 #define symbGetProcLastParam(f) iif( f->proc.mode = FB_FUNCMODE_PASCAL, f->proc.paramtb.tail, f->proc.paramtb.head )
2168 #define symbGetProcPrevParam(f,a) iif( f->proc.mode = FB_FUNCMODE_PASCAL, a->prev, a->next )
2169 
2170 #define symbGetProcHeadParam(f) f->proc.paramtb.head
2171 #define symbGetProcTailParam(f) f->proc.paramtb.tail
2172 
2173 #define symbGetProcCallback(f) f->proc.rtl.callback
2174 #define symbSetProcCallback(f,cb) f->proc.rtl.callback = cb
2175 
2176 #define symbGetProcIsOverloaded(f) ((f->attrib and FB_SYMBATTRIB_OVERLOADED) > 0)
2177 
2178 #define symGetProcOvlMinParams(f) f->proc.ovl.minparams
2179 
2180 #define symGetProcOvlMaxParams(f) f->proc.ovl.maxparams
2181 
2182 #define symbGetProcIncFile(f) f->proc.ext->dbg.incfile
2183 
2184 #define symbGetProcRealType( sym ) (sym)->proc.realdtype
2185 #define symbGetProcRealSubtype( sym ) (sym)->proc.realsubtype
2186 declare sub symbProcRecalcRealType( byval proc as FBSYMBOL ptr )
2187 
2188 #define symbGetProcSymbTb(f) f->proc.symtb
2189 
2190 #define symbGetProcSymbTbHead(f) f->proc.symtb.head
2191 
2192 #define symbGetProcOvlNext(f) f->proc.ovl.next
2193 
2194 #define symbGetProcStatReturnUsed(f) ((f->proc.ext->stats and FB_PROCSTATS_RETURNUSED) <> 0)
2195 #define symbSetProcStatReturnUsed(f) f->proc.ext->stats or= FB_PROCSTATS_RETURNUSED
2196 
2197 #define symbGetProcStatAssignUsed(f) ((f->proc.ext->stats and FB_PROCSTATS_ASSIGNUSED) <> 0)
2198 #define symbSetProcStatAssignUsed(f) f->proc.ext->stats or= FB_PROCSTATS_ASSIGNUSED
2199 
2200 #define symbGetProcPriority(f) f->proc.ext->priority
2201 
2202 #macro symbSetProcPriority(f,p)
2203  symbProcAllocExt( f )
2204  f->proc.ext->priority = p
2205 #endmacro
2206 
2207 #define symbGetProcStatGosub(f) ((f->proc.ext->stats and FB_PROCSTATS_GOSUBUSED) <> 0)
2208 #define symbSetProcStatGosub(f) f->proc.ext->stats or= FB_PROCSTATS_GOSUBUSED
2209 
2210 #define symbGetProcGosubSym(f) f->proc.ext->gosub.ctx
2211 #define symbSetProcGosubSym(f,p) f->proc.ext->gosub.ctx = p
2212 
2213 #define symbGetProcLocalOfs(p) p->proc.ext->stk.localofs
2214 #define symbSetProcLocalOfs(p,ofs) p->proc.ext->stk.localofs = ofs
2215 
2216 #define symbGetProcOpOvl(f) f->proc.ext->opovl.op
2217 
2218 #macro symbSetProcOpOvl(f, op_)
2219  symbProcAllocExt( f )
2220  f->proc.ext->opovl.op = op_
2221 #endmacro
2222 
2223 #define symbGetParamMode(a) a->param.mode
2224 
2225 #define symbGetParamVar(a) a->param.var
2226 
2227 #define symbGetParamOptExpr(a) a->param.optexpr
2228 
2229 #define symbGetParamPrev(a) a->prev
2230 
2231 #define symbGetParamNext(a) a->next
2232 
2233 #define symbGetImportNamespc(s) s->nsimp.imp_ns
2234 
2235 #define symbGetImportNext(s) s->nsimp.imp_next
2236 
2237 #define symbGetExportNamespc(s) s->nsimp.exp_ns
2238 
2239 #define symbGetExportNext(s) s->nsimp.exp_next
2240 
2241 #define symbGetIsDynamic(s) ((s->attrib and (FB_SYMBATTRIB_DYNAMIC or FB_SYMBATTRIB_PARAMBYDESC)) <> 0 )
2242 
2243 #define symbIsShared(s) ((s->attrib and FB_SYMBATTRIB_SHARED) <> 0)
2244 
2245 #define symbIsStatic(s) ((s->attrib and FB_SYMBATTRIB_STATIC) <> 0)
2246 
2247 #define symbIsDynamic(s) ((s->attrib and FB_SYMBATTRIB_DYNAMIC) <> 0)
2248 
2249 #define symbIsCommon(s) ((s->attrib and FB_SYMBATTRIB_COMMON) <> 0)
2250 
2251 #define symbIsTemp(s) ((s->attrib and FB_SYMBATTRIB_TEMP) <> 0)
2252 
2253 #define symbIsParamByDesc(s) ((s->attrib and FB_SYMBATTRIB_PARAMBYDESC) <> 0)
2254 
2255 #define symbIsParamByVal(s) ((s->attrib and FB_SYMBATTRIB_PARAMBYVAL) <> 0)
2256 
2257 #define symbIsParamByRef(s) ((s->attrib and FB_SYMBATTRIB_PARAMBYREF) <> 0)
2258 
2259 #define symbIsParamInstance(s) ((s->attrib and FB_SYMBATTRIB_PARAMINSTANCE) <> 0)
2260 
2262 
2263 #define symbIsParamBydescOrByref(s) (((s)->attrib and (FB_SYMBATTRIB_PARAMBYDESC or FB_SYMBATTRIB_PARAMBYREF)) <> 0)
2264 
2265 #define symbIsLocal(s) ((s->attrib and FB_SYMBATTRIB_LOCAL) <> 0)
2266 
2267 #define symbIsPublic(s) ((s->attrib and FB_SYMBATTRIB_PUBLIC) <> 0)
2268 
2269 #define symbIsPrivate(s) ((s->attrib and FB_SYMBATTRIB_PRIVATE) <> 0)
2270 
2271 #define symbIsExtern(s) ((s->attrib and FB_SYMBATTRIB_EXTERN) <> 0)
2272 
2273 #define symbIsExport(s) ((s->attrib and FB_SYMBATTRIB_EXPORT) <> 0)
2274 
2275 #define symbIsImport(s) ((s->attrib and FB_SYMBATTRIB_IMPORT) <> 0)
2276 
2277 #define symbIsOverloaded(s) ((s->attrib and FB_SYMBATTRIB_OVERLOADED) <> 0)
2278 
2279 #define symbIsConstructor(s) ((s->attrib and FB_SYMBATTRIB_CONSTRUCTOR) <> 0)
2280 
2281 #define symbIsDestructor(s) ((s->attrib and FB_SYMBATTRIB_DESTRUCTOR) <> 0)
2282 
2283 #define symbIsOperator(s) ((s->attrib and FB_SYMBATTRIB_OPERATOR) <> 0)
2284 
2285 #define symbIsProperty(s) ((s->attrib and FB_SYMBATTRIB_PROPERTY) <> 0)
2286 
2287 #define symbIsMethod(s) ((s->attrib and FB_SYMBATTRIB_METHOD) <> 0)
2288 
2289 #define symbIsDescriptor(s) ((s->attrib and FB_SYMBATTRIB_DESCRIPTOR) <> 0)
2290 
2291 #define symbIsConstant(s) ((s->attrib and FB_SYMBATTRIB_CONST) <> 0)
2292 
2293 #define symbGetIsLiteral(s) ((s->attrib and FB_SYMBATTRIB_LITERAL) <> 0)
2294 
2295 #define symbGetIsOptional(s) ((s->attrib and FB_SYMBATTRIB_OPTIONAL) <> 0)
2296 
2297 #define symbIsLiteralConst(s) ((s->attrib and FB_SYMBATTRIB_LITCONST) <> 0)
2298 
2299 #define symbProcReturnsByref(s) ((s->attrib and FB_SYMBATTRIB_RETURNSBYREF) <> 0)
2300 
2301 #define symbIsNaked( s ) (((s)->attrib and FB_SYMBATTRIB_NAKED) <> 0)
2302 
2303 #define symbIsAbstract(s) ((s->attrib and FB_SYMBATTRIB_ABSTRACT) <> 0)
2304 
2305 #define symbIsVirtual(s) ((s->attrib and FB_SYMBATTRIB_VIRTUAL) <> 0)
2306 
2307 #define symbGetProcStaticLocals(s) ((s->attrib and FB_SYMBATTRIB_STATICLOCALS) <> 0)
2308 
2309 #define symbIsSuffixed(s) ((s->attrib and FB_SYMBATTRIB_SUFFIXED) <> 0)
2310 
2311 #define symbGetCurrentProcName( ) symbGetName( parser.currproc )
2312 
2313 #define symbGetLastLabel( ) symb.lastlbl
2314 #define symbSetLastLabel( l ) symb.lastlbl = l
2315 
2316 '' assuming all UDT's extend FBS_NAMESPACE
2317 #define symbCompAllocExt( ) listNewNode( @symb.nsextlist )
2318 
2319 #define symbCompFreeExt( n ) listDelNode( @symb.nsextlist, n )
2320 
2321 #define symbGetCompSymbTb( s ) symbGetNamespaceSymbTb( s )
2322 
2323 #define symbGetCompHashTb( s ) symbGetNamespaceHashTb( s )
2324 
2325 #define symbGetCompExt( s ) s->nspc.ns.ext
2326 
2327 #define symbGetCompImportHead( s ) s->nspc.ns.ext->implist.head
2328 
2329 #define symbGetCompExportHead( s ) s->nspc.ns.ext->explist.head
2330 
2331 #define symbLookupCompField( parent, id ) symbLookupAt( parent, id, FALSE, TRUE )
2332 
2333 '' datatype accessors
2334 
2335 #define typeGetClass( dt ) symb_dtypeTB(typeGet( dt )).class
2336 #define typeGetSize( dt ) symb_dtypeTB(typeGet( dt )).size
2337 #define typeGetBits( dt ) (typeGetSize( dt ) * 8)
2338 #define typeIsSigned( dt ) symb_dtypeTB(typeGet( dt )).signed
2339 #define typeGetIntRank( dt ) symb_dtypeTB(typeGet( dt )).intrank
2340 #define typeGetRemapType( dt ) symb_dtypeTB(typeGet( dt )).remaptype
2341 #define typeGetSizeType( dt ) symb_dtypeTB(typeGet( dt )).sizetype
2342 
2343 #define typeGet( dt ) iif( dt and FB_DT_PTRMASK, FB_DATATYPE_POINTER, dt and FB_DT_TYPEMASK )
2344 #define typeGetDtOnly( dt ) (dt and FB_DT_TYPEMASK)
2345 #define typeGetDtAndPtrOnly( dt ) (dt and (FB_DT_TYPEMASK or FB_DT_PTRMASK))
2346 #define typeJoin( dt, ndt ) ((dt and (not (FB_DT_TYPEMASK or FB_DT_PTRMASK))) or (ndt and (FB_DT_TYPEMASK or FB_DT_PTRMASK)))
2347 #define typeJoinDtOnly( dt, ndt ) ((dt and (not FB_DT_TYPEMASK)) or (ndt and FB_DT_TYPEMASK))
2348 
2349 #define typeAddrOf( dt ) _
2350  ((dt and FB_DT_TYPEMASK) or _
2351  ((dt and FB_DT_PTRMASK) + (1 shl FB_DT_PTRPOS)) or _
2352  ((dt and FB_DT_CONSTMASK) shl 1))
2353 
2354 #define typeMultAddrOf( dt, cnt ) _
2355  ((dt and FB_DT_TYPEMASK) or _
2356  ((dt and FB_DT_PTRMASK) + (cnt shl FB_DT_PTRPOS)) or _
2357  ((dt and FB_DT_CONSTMASK) shl cnt))
2358 
2359 #define typeDeref( dt ) _
2360  ((dt and FB_DT_TYPEMASK) or _
2361  ((dt and FB_DT_PTRMASK) - (1 shl FB_DT_PTRPOS)) or _
2362  (((dt and FB_DT_CONSTMASK) shr 1) and FB_DT_CONSTMASK))
2363 
2364 #define typeMultDeref( dt, cnt ) _
2365  ((dt and FB_DT_TYPEMASK) or _
2366  ((dt and FB_DT_PTRMASK) - (cnt shl FB_DT_PTRPOS)) or _
2367  (((dt and FB_DT_CONSTMASK) shr cnt) and FB_DT_CONSTMASK))
2368 
2369 #define typeIsPtr( dt ) (((dt and FB_DT_PTRMASK) <> 0))
2370 #define typeGetPtrCnt( dt ) ((dt and FB_DT_PTRMASK) shr FB_DT_PTRPOS)
2371 
2372 #define typeIsConstAt( dt, at ) ((dt and (1 shl (FB_DT_CONSTPOS + at))) <> 0)
2373 #define typeIsConst( dt ) typeIsConstAt(dt, 0)
2374 #define typeSetIsConst( dt ) (dt or (1 shl FB_DT_CONSTPOS))
2375 #define typeUnsetIsConst( dt ) (dt and not (1 shl FB_DT_CONSTPOS))
2376 #define typeGetConstMask( dt ) (dt and FB_DT_CONSTMASK)
2377 #define typeGetPtrConstMask( dt ) _
2378  (typeGetConstMask( dt ) and not (1 shl FB_DT_CONSTPOS))
2379 
2380 #define typeIsRef( dt ) ((dt and FB_DATATYPE_REFERENCE) <> 0)
2381 #define typeSetIsRef( dt ) (dt or FB_DATATYPE_REFERENCE)
2382 #define typeUnsetIsRef( dt ) (dt and not FB_DATATYPE_REFERENCE)
2383 
2384 #define typeIsArray( dt ) ((dt and FB_DATATYPE_ARRAY) <> 0)
2385 #define typeSetIsArray( dt ) (dt or FB_DATATYPE_ARRAY)
2386 #define typeUnsetIsArray( dt ) (dt and not FB_DATATYPE_ARRAY)
2387 
2388 #define typeSetIsRefAndArray( dt ) (dt or (FB_DATATYPE_REFERENCE or FB_DATATYPE_ARRAY))
2389 
2390 #if __FB_DEBUG__
2391 declare function typeDump _
2392  ( _
2393  byval dtype as integer, _
2394  byval subtype as FBSYMBOL ptr _
2395  ) as string
2396 '' For debugging, e.g. use like this:
2397 '' symbTrace(a), "(replacing this)"
2398 '' symbTrace(b), "(with this)"
2399 #define symbTrace( s ) print __FUNCTION__ + "(" & __LINE__ & "): "; symbDump( s )
2400 declare function symbDump( byval s as FBSYMBOL ptr ) as string
2401 declare sub symbDumpNamespace( byval ns as FBSYMBOL ptr )
2402 #endif
2403 
2404 ''
2405 '' inter-module globals
2406 ''
2407 extern symb as SYMBCTX
2408 
2409 extern symb_dtypeTB( 0 to FB_DATATYPES-1 ) as SYMB_DATATYPE
2410 
2412