13 ast.
data.lastsym = NULL
14 ast.
data.firstsym = NULL
15 ast.
data.lastlbl = NULL
24 dim as ASTNODE
ptr n =
any
27 n =
astNewNode( AST_NODECLASS_DATASTMT, FB_DATATYPE_INVALID )
36 byval tree
as ASTNODE
ptr, _
37 byval expr
as ASTNODE
ptr _
40 dim as ASTNODE
ptr n =
any
43 n =
astNewNode( AST_NODECLASS_DATASTMT, FB_DATATYPE_INVALID )
48 if( tree->l = NULL )
then
57 if( expr = NULL )
then
58 n->
data.id = FB_DATASTMT_ID_LINK
61 dim as FBSYMBOL
ptr litsym =
any
63 select case astGetDataType( expr )
64 case FB_DATATYPE_CHAR, FB_DATATYPE_WCHAR
71 if( litsym <> NULL )
then
73 if( astGetDataType( expr ) <> FB_DATATYPE_WCHAR )
then
74 n->
data.id = FB_DATASTMT_ID_ZSTR
77 n->
data.id = FB_DATASTMT_ID_WSTR
83 if( astIsOFFSET( expr ) )
then
84 n->
data.id = FB_DATASTMT_ID_OFFSET
86 n->
data.id = FB_DATASTMT_ID_CONST
99 dim as FBSYMBOL
ptr array =
any, elm =
any
100 dim as integer i =
any, id =
any
101 dim as ASTNODE
ptr n =
any, expr =
any, initree =
any
102 dim as string littext
118 for i = 0
to tree->
data.elmts - 1
124 select case n->
data.id
125 case FB_DATASTMT_ID_ZSTR
129 case FB_DATASTMT_ID_WSTR
130 id = FB_DATASTMT_ID_WSTR + _
134 case FB_DATASTMT_ID_CONST
139 case FB_DATASTMT_ID_NULL, FB_DATASTMT_ID_LINK
145 elm = symbGetUDTSymbTbHead( ast.
data.desc )
150 elm = symbGetNext( elm )
158 dim as ASTNODE
ptr nxt = n->r
168 symbSetTypeIniTree( array, initree )
169 symbSetIsInitialized( array )
172 if( ast.
data.lastsym <> NULL )
then
174 initree = symbGetTypeIniTree( astGetLastDataStmtSymbol( ) )
178 do while( n->r <> NULL )
179 if( n->
class = AST_NODECLASS_TYPEINI_ASSIGN )
then
198 array->var_.
data.prev = ast.
data.lastsym
200 ast.
data.lastsym = array
201 if( ast.
data.firstsym = NULL )
then
202 ast.
data.firstsym = array
209 byval label
as FBSYMBOL
ptr, _
210 byval elements
as integer _
214 static as FBARRAYDIM dTB(0
to 0)
215 dim as FBSYMBOL
ptr sym =
any, lastlabel =
any
217 if( label = NULL )
then
220 lastlabel = symbGetLastLabel( )
222 if( (lastlabel = NULL)
or (ast.
data.lastlbl = lastlabel) )
then
226 ast.
data.lastlbl = lastlabel
230 id = FB_DATASTMT_PREFIX + *symbGetName( lastlabel )
233 dTB(0).upper = elements - 1
240 id = FB_DATASTMT_PREFIX + *symbGetName( label )
247 if( sym <> NULL )
then
248 if( label = NULL )
then
256 FB_DATATYPE_STRUCT, ast.
data.desc, 0, _
258 FB_SYMBATTRIB_SHARED
or FB_SYMBATTRIB_STATIC, _
259 FB_SYMBOPT_MOVETOGLOB
or FB_SYMBOPT_PRESERVECASE )
262 sym->var_.
data.prev = NULL
268 static as FBARRAYDIM dTB(0)
271 ast.
data.desc =
symbStructBegin( NULL, NULL,
"__FB_DATADESC$", NULL, FALSE, 1, NULL, 0 )
275 FB_DATATYPE_SHORT, NULL, 0, 0 )
279 typeAddrOf( FB_DATATYPE_VOID ), NULL, 0, 0 )