Changeset 103 in dev for BasicCompiler_Common/Const.h
- Timestamp:
- May 2, 2007, 4:08:58 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Const.h
r7 r103 2 2 3 3 //定数の基底クラス 4 class CConstBase{ 5 char *Name; 4 class ConstBase{ 5 const string name; 6 const NamespaceScopes namespaceScopes; 6 7 7 8 public: 8 9 9 CConstBase(char *Name); 10 ~CConstBase(); 10 ConstBase( const NamespaceScopes &namespaceScopes, const string &name ) 11 : namespaceScopes( namespaceScopes ) 12 , name( name ) 13 { 14 } 15 ~ConstBase() 16 { 17 } 11 18 12 char *GetName(); 19 const string &GetName() const 20 { 21 return name; 22 } 23 24 bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const; 25 bool IsEqualSymbol( const string &name ) const; 13 26 }; 14 27 15 28 //定数 16 class CConst:public C ConstBase{17 int Type;29 class CConst:public ConstBase{ 30 Type type; 18 31 _int64 i64data; 19 32 … … 21 34 CConst *pNext; 22 35 23 CConst( char *Name, int Type, _int64 i64data);24 CConst( char *Name, int value);36 CConst( const NamespaceScopes &namespaceScopes, const string &name, const Type &type, _int64 i64data); 37 CConst( const NamespaceScopes &namespaceScopes, const string &name, int value); 25 38 ~CConst(); 26 39 27 intGetType();40 Type GetType(); 28 41 _int64 GetWholeData(); 29 42 double GetDoubleData(); … … 31 44 32 45 //定数マクロ 33 class CConstMacro:public C ConstBase{46 class CConstMacro:public ConstBase{ 34 47 int ParmNum; 35 48 char **ppParm; 36 49 public: 37 50 38 CConstMacro( char *Name, char *Expression);51 CConstMacro( const NamespaceScopes &namespaceScopes, const string &name, char *Expression); 39 52 ~CConstMacro(); 40 53 }; … … 57 70 void Init(); 58 71 59 void Add( char *buffer);72 void Add( const NamespaceScopes &namespaceScopes, char *buffer); 60 73 private: 61 void AddConst( char *Name, CConst *newconst);74 void AddConst( const string &name, CConst *newconst); 62 75 public: 63 void AddConst( char *Name, char *Expression);64 void AddConst( char *Name, int value);76 void AddConst( const NamespaceScopes &namespaceScopes, const string &name, char *Expression); 77 void AddConst( const NamespaceScopes &namespaceScopes, const string &name, int value); 65 78 66 79 private: 67 CConst *GetObjectPtr( char *Name);80 CConst *GetObjectPtr( const string &name ); 68 81 public: 69 82 70 int Get Type(char *Name);83 int GetBasicType(char *Name); 71 84 _int64 GetWholeData(char *Name); 72 85 double GetDoubleData(char *Name); 86 bool IsStringPtr(char *Name); 73 87 74 88
Note:
See TracChangeset
for help on using the changeset viewer.