10 sub hGetType(
byref dtype
as integer,
byref subtype
as FBSYMBOL
ptr )
17 dtype = FB_DATATYPE_INTEGER
22 if( subtype <> NULL )
then
24 if( dtype <> FB_DATATYPE_ENUM )
then
25 errReport( FB_ERRMSG_INVALIDDATATYPES, TRUE )
27 dtype = FB_DATATYPE_INVALID
32 select case as const typeGet( dtype )
33 case FB_DATATYPE_VOID, FB_DATATYPE_FIXSTR, _
34 FB_DATATYPE_CHAR, FB_DATATYPE_WCHAR
35 errReport( FB_ERRMSG_INVALIDDATATYPES, TRUE )
37 dtype = FB_DATATYPE_INVALID
41 dtype = FB_DATATYPE_INVALID
49 byval dtype
as integer, _
50 byval subtype
as FBSYMBOL
ptr, _
51 byval attrib
as FB_SYMBATTRIB _
54 static as zstring * FB_MAXNAMELEN+1 id
55 dim as integer doskip =
any, suffix =
any
56 dim as ASTNODE
ptr expr =
any
57 dim as FBSYMBOL
ptr litsym =
any
58 dim as FBVALUE value =
any
65 case FB_TKCLASS_IDENTIFIER
66 if( fbLangOptIsSet( FB_LANG_OPT_PERIODS ) )
then
68 if( symbIsGlobalNamespc( ) = FALSE )
then
69 if( lexGetPeriodPos( ) > 0 )
then
75 case FB_TKCLASS_QUIRKWD
76 if( env.clopt.lang <> FB_LANG_QB )
then
78 if( (symbIsGlobalNamespc( ))
or (parser.
scope > FB_MAINSCOPE) )
then
86 case FB_TKCLASS_KEYWORD, FB_TKCLASS_OPERATOR
87 if( env.clopt.lang <> FB_LANG_QB )
then
101 suffix = lexGetType( )
104 hCheckSuffix( suffix )
110 if( dtype = FB_DATATYPE_INVALID )
then
116 if( suffix <> FB_DATATYPE_INVALID )
then
117 if( dtype <> FB_DATATYPE_INVALID )
then
124 attrib
or= FB_SYMBATTRIB_SUFFIXED
136 if( expr = NULL )
then
144 dim as integer exprdtype = astGetDataType( expr )
146 select case exprdtype
147 case FB_DATATYPE_CHAR, FB_DATATYPE_WCHAR
152 if( litsym <> NULL )
then
153 if( dtype <> FB_DATATYPE_INVALID )
then
155 if( typeGetDtAndPtrOnly( dtype ) <> FB_DATATYPE_STRING )
then
161 if(
symbAddConst( @id, exprdtype, NULL, @value, attrib ) = NULL )
then
167 if( astIsCONST( expr ) = FALSE )
then
172 exprdtype = FB_DATATYPE_INTEGER
176 if( dtype <> FB_DATATYPE_INVALID )
then
178 if( typeGet( dtype ) = FB_DATATYPE_STRING )
then
188 if( (dtype <> exprdtype)
or _
189 (subtype <> astGetSubtype( expr )) )
then
192 if( expr = NULL )
then
196 dtype = FB_DATATYPE_INTEGER
205 subtype = astGetSubtype( expr )
208 if(
symbAddConst( @id, dtype, subtype, astConstGetVal( expr ), attrib ) = NULL )
then
223 dim as integer dtype =
any
224 dim as FBSYMBOL
ptr subtype =
any