00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef INC_SML_SYMBOL_H
00037 #define INC_SML_SYMBOL_H
00038
00039 #ifndef INC_SML_USERDATA_H
00040 #include <sml/userdata.h>
00041 #endif
00042
00043 #ifndef INC_SML_STYPE_H
00044 #include <sml/stype.h>
00045 #endif
00046
00047 #ifndef INC_MI32_SMLBASE_H
00048 #include <mi32/smlbase.h>
00049 #endif
00050
00051 #ifdef RVCSYSDLL
00052 #define RVCSYSLIBEXPORT MI_DLLEXPORT
00053 #define RVCSYSLIBCLASSEXPORT MI_DLLCLASSEXPORT
00054 #else
00055 #define RVCSYSLIBEXPORT MI_DLLIMPORT
00056 #define RVCSYSLIBCLASSEXPORT MI_DLLCLASSIMPORT
00057 #endif
00058
00059 class MISTRING;
00060
00061
00062 #ifdef GetObject
00065 #undef GetObject
00066 #endif
00067
00068 namespace SML {
00069
00070 #ifndef GENERATING_DOXYGEN_OUTPUT
00071 typedef PTRINT MACHINEINST;
00072 class STRING;
00073 class CLASSARRAY;
00074 class USERDATA;
00075 class RASTEROBJECT;
00076 class VECTOROBJECT;
00077 class CADOBJECT;
00078 class TINOBJECT;
00079 class SHAPEOBJECT;
00080 class OBJECT;
00081 class FUNC;
00082 class PARM;
00083 class TABLEDATA;
00084 class CONTEXT;
00085 class CLASS;
00086 #endif
00087
00088
00089
00090 #define SYMBOL_DontFree 0x0100
00091 #define SYMBOL_Permanent 0x0200
00092 #define SYMBOL_Static 0x0400
00093
00094
00095
00102
00103
00104
00105 class RVCSYSLIBCLASSEXPORT SYMBOL {
00106 public:
00107
00108 enum SCOPE {
00109 SCOPE_NONE = 0,
00110 SCOPE_TABLE,
00111 SCOPE_BFUNCTION,
00112 SCOPE_KEYWORD,
00113 SCOPE_GLOBAL,
00114 SCOPE_LOCAL,
00115 SCOPE_PERMANENT,
00116 SCOPE_PROTOTYPE,
00117 SCOPE_STATIC
00118 };
00119
00120 public:
00121
00122
00129 void AttachUserData (
00130 USERDATA* data
00131 ) {
00132 m_userdata.Attach(data);
00133 return;
00134 }
00135
00140 void DetachUserData (
00141 USERDATA* data
00142 ) {
00143 m_userdata.Detach(data);
00144 return;
00145 }
00146
00148 void DisposeOfContents (
00149 );
00150
00151 double* GetArray (
00152 ) const;
00153
00154 int GetArrayNumLins (
00155 ) const;
00156
00157 int GetArrayNumCols (
00158 ) const;
00159
00161 const CLASS* GetClass (
00162 ) const;
00163
00166 USERDATA* GetUserData (
00167 USERDATA::TAG tag
00168 ) {
00169 return (m_userdata.Get(tag));
00170 }
00171
00172
00173
00174 bool IsPermanent (
00175 ) const;
00176
00178 ERRVALUE SetValue (
00179 const MIUNICODE *string
00180 );
00181
00182 void SetValuePtr (
00183 void* val
00184 );
00185
00190 int GetFieldType (
00191 ) const;
00192
00197 SYMBOL* GetFormalParameterSymbol (
00198 int parmnum
00199 ) const;
00200
00206 CLASS* GetFormalParameterClass (
00207 int parmnum
00208 ) const;
00209
00211 int GetFormalParameterType (
00212 int parmnum
00213 ) const;
00214
00216 const MIUNICODE* GetName (
00217 ) const;
00218
00224 const MIUNICODE* GetAltName (
00225 ) const;
00226
00228 SYMBOL* GetNext (
00229 );
00230
00232 const SYMBOL* GetNext (
00233 ) const;
00234
00235 int GetObject (
00236 OBJECT** pObj,
00237 bool UndefinedOK = false
00238 );
00239
00240 int GetObject (
00241 RASTEROBJECT** pObj,
00242 bool UndefinedOK = false
00243 );
00244
00245 int GetObject (
00246 VECTOROBJECT** pObj,
00247 bool UndefinedOK = false
00248 );
00249
00250 int GetObject (
00251 CADOBJECT** pObj,
00252 bool UndefinedOK = false
00253 );
00254
00255 int GetObject (
00256 TINOBJECT** pObj,
00257 bool UndefinedOK = false
00258 );
00259
00262 int GetFieldNumber (
00263 ) const;
00264
00268 const TABLEDATA* GetTableData (
00269 ) const;
00270
00273 int GetTableNumber (
00274 ) const;
00275
00276 STYPE GetType (
00277 ) const;
00278
00279 void SetType (
00280 STYPE type
00281 );
00282
00283 const char *GetTypeName (
00284 ) const;
00285
00287 int IsNULL (
00288 ) const;
00289
00291 bool IsOptionalArgument (
00292 ) const;
00293
00294
00295 void SetObjectElement (
00296 int ElemType,
00297 INT32 ElemNum
00298 );
00299
00300 void SetRasterLinCol (
00301 int lin,
00302 int col
00303 );
00304
00305
00309 bool GetValue (
00310 double& value
00311 ) const;
00312
00316 bool GetValue (
00317 MISTRING& value
00318 ) const;
00319
00320 MIUNICODE *GetValueUnicode (
00321 char *fmt,
00322 MIUNICODE *buf,
00323 int maxlen
00324 ) const ;
00325
00326 char *GetValueStr (
00327 char *fmt,
00328 char *buf,
00329 int maxlen
00330 ) const;
00331
00332 #if defined(ALLOW_RETIRED) || defined (RVCSYSDLL)
00333 #ifndef GENERATING_DOXYGEN_OUTPUT
00338 void GetValue (
00339 MISTRING& mistring,
00340 const char* format
00341 ) const;
00342 #endif // GENERATING_DOXYGEN_OUTPUT
00343 #endif
00344
00345 double GetValueDouble (
00346 ) const;
00347
00348 void* GetValuePtr () const;
00349 OBJECT* GetValueObj () const;
00350
00353 void SetValue(OBJECT*);
00354
00355 STRING* GetValueSTRING() const;
00356
00357 ERRVALUE ResizeArray (
00358 int numcols
00359 );
00360
00361 ERRVALUE ResizeArray (
00362 int numlines,
00363 int numcols,
00364 bool bKeep = false
00365 );
00366
00367 void SetArray (
00368 double *data,
00369 int numrows,
00370 int numcols
00371 );
00372
00374 int SetValueNULL (
00375 );
00376
00378 int SetValue (
00379 double value
00380 );
00381
00383 ERRVALUE SetValue (
00384 const char *string
00385 );
00386
00387
00388 #ifndef GENERATING_DOXYGEN_OUTPUT
00391 SYMBOL* GetLocalVars (
00392 ) const;
00393
00395 void SetLocalVars (
00396 SYMBOL* sym
00397 );
00398
00400 void SetNext (
00401 SYMBOL* sym
00402 );
00403
00404 void _SetNumCols(int);
00405
00407 FUNC* GetFunc() const;
00408
00409 int GetTypeRaw() const;
00410
00411
00412 friend class CONTEXT;
00413 friend class VM;
00414 friend class PARSER;
00415 friend int qqparse(void*);
00416 #endif // GENERATING_DOXYGEN_OUTPUT
00417
00418 private:
00419 void SetValuePtr (
00420 OBJECT* val
00421 );
00422
00423
00424 #ifndef GENERATING_DOXYGEN_OUTPUT
00425 public:
00426 #if !defined(RVCSYSDLL)
00427 private:
00428 #endif
00429
00430
00431 MIUNICODE *name;
00432
00433 union DATA {
00434 double val;
00435 void * ptr;
00436 void (*proc)(int, ARG*, UINT8 *, CONTEXT *);
00437 double (*func)(int, ARG*, UINT8 *, CONTEXT *);
00438 double (*dfunc)(double);
00439 SYMBOL *(*ofunc)(int, ARG*, UINT8 *, CONTEXT *);
00440 STRING * (*sfunc)(int, ARG*, UINT8 *, CONTEXT *);
00441 void * (*classfunc)(int, ARG*, UINT8 *, CONTEXT *);
00442 MACHINEINST defn;
00443 void *list;
00444 STRING *str;
00445 double *array;
00446 UINT8 *free_me;
00447 int pc;
00448 void *ClassData;
00449 CLASSARRAY *carray;
00450 struct {
00451 short tnum, fnum, ftype, spare;
00452 } field;
00453 } u;
00454 short type;
00455 short ptype;
00456 PARM *parm;
00457 union {
00458 short parmnum;
00459 short segnum;
00460 } u1;
00461 short flags;
00462
00463 long NumLins;
00464 long NumCols;
00465 union {
00466 TABLEDATA *table;
00467 CLASS *objclass;
00468 } u2;
00469 SYMBOL *tablesym;
00470 SYMBOL *localvars;
00471 SYMBOL *next;
00472 FUNC *smlfunc;
00473 CONTEXT *context;
00474 USERDATACONTAINER m_userdata;
00475 OBJECT* m_obj;
00476 MIUNICODE* m_altname;
00477 SYMBOL* m_NextOverload;
00478 INT32 m_Scope;
00479
00480 #endif // GENERATING_DOXYGEN_OUTPUT
00481
00482 };
00483
00485 RVCSYSLIBEXPORT int SameObject (
00486 SML::SYMBOL*,
00487 SML::SYMBOL*
00488 );
00489 }
00490
00491
00492
00493 typedef enum SML::SYMBOL::SCOPE SMLSCOPE;
00494 typedef SML::SYMBOL SMLSYMBOL;
00495
00496 #undef RVCSYSLIBEXPORT
00497 #undef RVCSYSLIBCLASSEXPORT
00498
00499 #endif // INC_SML_SYMBOL_H
00500
00501