Token.h

Go to the documentation of this file.
00001 /* /% C++ %/ */
00002 /***********************************************************************
00003  * cint (C/C++ interpreter)
00004  ************************************************************************
00005  * Header file Token.h
00006  ************************************************************************
00007  * Description:
00008  *  Extended Run Time Type Identification API
00009  ************************************************************************
00010  * Copyright(c) 1995~1999  Masaharu Goto 
00011  *
00012  * For the licensing terms see the file COPYING
00013  *
00014  ************************************************************************/
00015 
00016 
00017 #ifndef G__TOKENINFO_H
00018 #define G__TOKENINFO_H 
00019 
00020 
00021 #ifndef G__API_H
00022 #include "Api.h"
00023 #endif
00024 
00025 namespace Cint {
00026 
00027 class G__ClassInfo;
00028 class G__MethodInfo;
00029 
00030 /*********************************************************************
00031 * class G__TokenInfo
00032 *
00033 * Outcome of discussion between Nenad Buncic of CERN. 15 Mar 1997
00034 * 
00035 *********************************************************************/
00036 class 
00037 #ifndef __CINT__
00038 G__EXPORT
00039 #endif
00040 G__TokenInfo {
00041  public:
00042   enum G__TokenType { t_invalid                                   // p_invalid
00043                     , t_class , t_typedef, t_fundamental , t_enum    // p_type
00044                     , t_memberfunc, t_globalfunc                     // p_func
00045                     , t_datamember, t_local, t_global, t_enumelement // p_data
00046                     };
00047   enum G__TokenProperty {p_invalid , p_type , p_data, p_func};
00048 
00049   ~G__TokenInfo() {}
00050   G__TokenInfo() :
00051     tokentype(t_invalid), tokenproperty(p_invalid), methodscope(),
00052     bytecode(NULL), localvar(NULL), glob(), nextscope(), tinfo() { Init(); }
00053   G__TokenInfo(const G__TokenInfo& tki);
00054   G__TokenInfo& operator=(const G__TokenInfo& tki);
00055   void Init();
00056 
00057   // MakeLocalTable has to be used when entering to a new function
00058   G__MethodInfo MakeLocalTable(G__ClassInfo& tag_scope
00059                               ,const char* fname,const char* paramtype);
00060 
00061   // Query has to be used to get information for each token
00062   int Query(G__ClassInfo& tag_scope,G__MethodInfo& func_scope
00063             ,const char* preopr,const char* name,const char* postopr);
00064 
00065   // Following functions have to be called after Query 
00066   enum G__TokenType GetTokenType() { return(tokentype); }
00067   enum G__TokenProperty GetTokenProperty() { return(tokenproperty); }
00068   G__ClassInfo GetNextScope() { return(nextscope); }
00069 
00070  private:
00071   enum G__TokenType tokentype; 
00072   enum G__TokenProperty tokenproperty; 
00073   G__MethodInfo methodscope;
00074   struct G__bytecodefunc *bytecode;
00075   struct G__var_array *localvar;
00076   G__ClassInfo glob;
00077   G__ClassInfo nextscope;
00078   G__TypeInfo tinfo;
00079 
00080   int SearchTypeName(const char* name,const char* postopr);
00081   int SearchLocalVariable(const char* name,G__MethodInfo& func_scope
00082                           ,const char* postopr);
00083   int SearchDataMember(const char* name,G__ClassInfo& tag_scope
00084                        ,const char* postopr);
00085   int SearchGlobalVariable(const char* name,const char* postopr);
00086   int SearchMemberFunction(const char* name,G__ClassInfo& tag_scope);
00087   int SearchGlobalFunction(const char* name);
00088   void GetNextscope(const char* name,G__ClassInfo& tag_scope);
00089 };
00090 
00091 } // namespace Cint
00092 
00093 /*********************************************************************
00094 * memo
00095 *
00096 *  int G__loadfile(char* fname);
00097 *    #define G__LOADFILE_SUCCESS         0
00098 *    #define G__LOADFILE_DUPLICATE       1
00099 *    #define G__LOADFILE_FAILURE       (-1)
00100 *    #define G__LOADFILE_FATAL         (-2)
00101 *
00102 *  int G__unloadfile(char* fname);
00103 *    #define G__UNLOADFILE_SUCCESS    0
00104 *    #define G__UNLOADFILE_FAILURE  (-1)
00105 *
00106 *  void G__add_ipath(char* pathname);
00107 *
00108 *  in src/Class.h
00109 *  class G__ClassInfo {
00110 *   public:
00111 *    G__ClassInfo();
00112 *    Init(char* classname);
00113 *    int IsValid();
00114 *    ..
00115 *  };
00116 *
00117 *  in src/Method.h
00118 *  class G__MethodInfo {
00119 *   public:
00120 *    G__MethodInfo();
00121 *    G__MethodInfo(G__ClassInfo& scope);
00122 *    Init();
00123 *    Init(G__ClassInfo& scope);
00124 *    int IsValid();
00125 *    ..
00126 *  };
00127 * 
00128 *********************************************************************/
00129 
00130 using namespace Cint;
00131 #endif

Generated on Tue Jul 5 14:27:41 2011 for ROOT_528-00b_version by  doxygen 1.5.1