1    	/* /% C++ %/ */
2    	/***********************************************************************
3    	 * cint (C/C++ interpreter)
4    	 ************************************************************************
5    	 * Header file Token.h
6    	 ************************************************************************
7    	 * Description:
8    	 *  Extended Run Time Type Identification API
9    	 ************************************************************************
10   	 * Copyright(c) 1995~1999  Masaharu Goto 
11   	 *
12   	 * For the licensing terms see the file COPYING
13   	 *
14   	 ************************************************************************/
15   	
16   	
17   	#ifndef G__TOKENINFO_H
18   	#define G__TOKENINFO_H 
19   	
20   	
21   	#ifndef G__API_H
22   	#include "Api.h"
23   	#endif
24   	
25   	namespace Cint {
26   	
27   	class G__ClassInfo;
28   	class G__MethodInfo;
29   	
30   	/*********************************************************************
31   	* class G__TokenInfo
32   	*
33   	* Outcome of discussion between Nenad Buncic of CERN. 15 Mar 1997
34   	* 
35   	*********************************************************************/
36   	class 
37   	#ifndef __CINT__
38   	G__EXPORT
39   	#endif
40   	G__TokenInfo {
41   	 public:
42   	  enum G__TokenType { t_invalid                                   // p_invalid
43   	                    , t_class , t_typedef, t_fundamental , t_enum    // p_type
44   	                    , t_memberfunc, t_globalfunc                     // p_func
45   	                    , t_datamember, t_local, t_global, t_enumelement // p_data
46   	                    };
47   	  enum G__TokenProperty {p_invalid , p_type , p_data, p_func};
48   	
49   	  ~G__TokenInfo() {}
50   	  G__TokenInfo() :
51   	    tokentype(t_invalid), tokenproperty(p_invalid), methodscope(),
52   	    bytecode(NULL), localvar(NULL), glob(), nextscope(), tinfo() { Init(); }
53   	  G__TokenInfo(const G__TokenInfo& tki);
54   	  G__TokenInfo& operator=(const G__TokenInfo& tki);
55   	  void Init();
56   	
57   	  // MakeLocalTable has to be used when entering to a new function
58   	  G__MethodInfo MakeLocalTable(G__ClassInfo& tag_scope
59   	                              ,const char* fname,const char* paramtype);
60   	
61   	  // Query has to be used to get information for each token
62   	  int Query(G__ClassInfo& tag_scope,G__MethodInfo& func_scope
63   		    ,const char* preopr,const char* name,const char* postopr);
64   	
65   	  // Following functions have to be called after Query 
66   	  enum G__TokenType GetTokenType() { return(tokentype); }
67   	  enum G__TokenProperty GetTokenProperty() { return(tokenproperty); }
68   	  G__ClassInfo GetNextScope() { return(nextscope); }
69   	
70   	 private:
71   	  enum G__TokenType tokentype; 
72   	  enum G__TokenProperty tokenproperty; 
73   	  G__MethodInfo methodscope;
74   	  struct G__bytecodefunc *bytecode;
75   	  struct G__var_array *localvar;
76   	  G__ClassInfo glob;
77   	  G__ClassInfo nextscope;
78   	  G__TypeInfo tinfo;
79   	
80   	  int SearchTypeName(const char* name,const char* postopr);
81   	  int SearchLocalVariable(const char* name,G__MethodInfo& func_scope
82   				  ,const char* postopr);
83   	  int SearchDataMember(const char* name,G__ClassInfo& tag_scope
84   			       ,const char* postopr);
85   	  int SearchGlobalVariable(const char* name,const char* postopr);
86   	  int SearchMemberFunction(const char* name,G__ClassInfo& tag_scope);
87   	  int SearchGlobalFunction(const char* name);
88   	  void GetNextscope(const char* name,G__ClassInfo& tag_scope);
89   	};
90   	
91   	} // namespace Cint
92   	
93   	/*********************************************************************
94   	* memo
95   	*
96   	*  int G__loadfile(char* fname);
97   	*    #define G__LOADFILE_SUCCESS         0
98   	*    #define G__LOADFILE_DUPLICATE       1
99   	*    #define G__LOADFILE_FAILURE       (-1)
100  	*    #define G__LOADFILE_FATAL         (-2)
101  	*
102  	*  int G__unloadfile(char* fname);
103  	*    #define G__UNLOADFILE_SUCCESS    0
104  	*    #define G__UNLOADFILE_FAILURE  (-1)
105  	*
106  	*  void G__add_ipath(char* pathname);
107  	*
108  	*  in src/Class.h
109  	*  class G__ClassInfo {
110  	*   public:
111  	*    G__ClassInfo();
112  	*    Init(char* classname);
113  	*    int IsValid();
114  	*    ..
115  	*  };
116  	*
117  	*  in src/Method.h
118  	*  class G__MethodInfo {
119  	*   public:
120  	*    G__MethodInfo();
121  	*    G__MethodInfo(G__ClassInfo& scope);
122  	*    Init();
123  	*    Init(G__ClassInfo& scope);
124  	*    int IsValid();
125  	*    ..
126  	*  };
127  	* 
128  	*********************************************************************/
129  	
130  	using namespace Cint;
131  	#endif
132