Changeset 181 in dev for trunk/jenga/include
- Timestamp:
- Jun 24, 2007, 2:05:40 PM (17 years ago)
- Location:
- trunk/jenga/include
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jenga/include/smoothie/Class.h
r180 r181 46 46 }; 47 47 48 pr ivate:48 protected: 49 49 ClassType classType; 50 50 51 51 bool isReady; 52 void Readed(){53 isReady = true;54 }55 bool IsReady() const{56 return isReady;57 }58 52 59 53 // importされている名前空間 … … 90 84 CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name ); 91 85 ~CClass(); 86 87 void Readed(){ 88 isReady = true; 89 } 90 bool IsReady() const{ 91 return isReady; 92 } 92 93 93 94 const NamespaceScopesCollection &GetImportedNamespaces() const … … 126 127 } 127 128 128 //継承させる 129 bool Inherits( const char *inheritNames, int nowLine ); 130 bool InheritsClass( const CClass &inheritsClass, int nowLine ); 131 bool InheritsInterface( const CClass &inheritsClass, int nowLine ); 132 133 //メンバ、メソッドの追加 134 void AddMember( Prototype::Accessibility accessibility, bool idConst, bool isRef, char *buffer ); 135 void AddStaticMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine ); 129 // 継承させる 130 virtual bool Inherits( const char *inheritNames, int nowLine ) = 0; 131 virtual bool InheritsClass( const CClass &inheritsClass, int nowLine ) = 0; 132 virtual bool InheritsInterface( const CClass &inheritsClass, int nowLine ) = 0; 133 134 virtual void AddMember( Prototype::Accessibility accessibility, bool idConst, bool isRef, char *buffer, int nowLine ) = 0; 135 virtual void AddStaticMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine ) = 0; 136 137 virtual void AddMethod(CClass *pobj_c, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract, 138 bool isVirtual, bool isOverride, char *buffer, int nowLine) = 0; 136 139 137 140 //重複チェック … … 173 176 } 174 177 175 //デフォルト コンストラクタ メソッドを取得178 //デフォルト コンストラクタ 176 179 const CMethod *GetConstructorMethod() const; 180 void SetConstructorMemberSubIndex( int constructorMemberSubIndex ) 181 { 182 this->ConstructorMemberSubIndex = constructorMemberSubIndex; 183 } 177 184 178 185 //デストラクタ メソッドを取得 179 186 const CMethod *GetDestructorMethod() const; 187 void SetDestructorMemberSubIndex( int destructorMemberSubIndex ) 188 { 189 this->DestructorMemberSubIndex = destructorMemberSubIndex; 190 } 180 191 181 192 // vtblに存在する仮想関数の数 … … 209 220 210 221 //vtbl 211 pr ivate:222 protected: 212 223 mutable long vtbl_offset; 213 224 public: 214 225 int GetFuncNumInVtbl( const UserProc *pUserProc ) const; 215 LONG_PTR GetVtblGlobalOffset(void) const;216 v oid ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection);226 virtual LONG_PTR GetVtblGlobalOffset(void) const = 0; 227 virtual void ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection) = 0; 217 228 bool IsAbstract() const; 218 229 … … 306 317 const CClass *Find( const NamespaceScopes &namespaceScopes, const string &name ) const; 307 318 308 CClass *AddClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name,int nowLine); 319 virtual CClass *Create( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name) = 0; 320 CClass *Add( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name,int nowLine); 309 321 310 322 void ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection); 311 323 312 private:313 void AddMethod(CClass *pobj_c, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract,314 bool isVirtual, bool isOverride, char *buffer, int nowLine);315 BOOL MemberVar_LoopRefCheck(const CClass &objClass);316 324 public: 317 325 318 326 // 実体収集 319 327 virtual void CollectClassesForNameOnly( const BasicSource &source ) = 0; 328 virtual void GetClass_recur(const char *lpszInheritsClass) = 0; 320 329 virtual void GetAllClassInfo() = 0; 321 330 virtual void Compile_System_InitializeUserTypes() = 0; -
trunk/jenga/include/smoothie/LexicalScoping.h
r174 r181 44 44 int level; 45 45 46 CScope *SearchScope( SCOPE_TYPE TypeOfStatement );47 48 46 virtual CScope *CreateScope( int level, int addr, SCOPE_TYPE TypeOfStatement ) = 0; 49 47 public: … … 57 55 void Start( int addr, SCOPE_TYPE TypeOfStatement ); 58 56 59 // スコープを終了57 // スコープを終了 60 58 void End(); 61 59 62 // スコープ抜け出しステートメント63 void Break();60 // スコープを検索 61 CScope *SearchScope( SCOPE_TYPE TypeOfStatement ); 64 62 65 63 int GetNowLevel(void); -
trunk/jenga/include/smoothie/Member.h
r180 r181 53 53 } 54 54 55 CMember( Prototype::Accessibility accessibility, const string &name, const Type &type, bool isConst )55 CMember( Prototype::Accessibility accessibility, const string &name, const Type &type, bool isConst, const string &initializeExpression, const string &constructParameter ) 56 56 : MemberPrototype( accessibility ) 57 57 , name( name ) 58 58 , type( type ) 59 59 , isConst( isConst ) 60 , initializeExpression( initializeExpression ) 61 , constructParameter( constructParameter ) 60 62 { 61 63 } -
trunk/jenga/include/smoothie/ObjectModule.h
r180 r181 9 9 class Meta{ 10 10 Classes *pClasses; 11 ProcPointers *pProcPointers; 11 12 public: 12 13 13 Meta( Classes *pNewClasses )14 Meta( Classes *pNewClasses, ProcPointers *pNewProcPointers ) 14 15 : pClasses( pNewClasses ) 16 , pProcPointers( pNewProcPointers ) 15 17 { 16 18 } … … 18 20 { 19 21 delete pClasses; 22 delete pProcPointers; 20 23 } 21 24 … … 28 31 return *pClasses; 29 32 } 33 void SetClasses( Classes *pClasses ) 34 { 35 this->pClasses = pClasses; 36 } 30 37 31 38 // TypeDef … … 33 40 34 41 // 関数ポインタ 35 vector<ProcPointer *> procPointers; 42 ProcPointers &GetProcPointers() 43 { 44 return *pProcPointers; 45 } 36 46 37 47 // blittable型 -
trunk/jenga/include/smoothie/Parameter.h
r170 r181 1 1 #pragma once 2 2 3 #include <string> 4 #include <vector> 5 3 6 #include "Type.h" 4 5 7 #include "BasicFixed.h" 6 8 7 9 class Parameter : public Type 8 10 { 9 st ring varName;11 std::string varName; 10 12 bool isRef; 11 13 bool isArray; 12 14 int subScripts[MAX_ARRAYDIM]; 13 15 14 const st ring initValue;16 const std::string initValue; 15 17 16 18 public: 17 Parameter( const st ring &varName, const Type &type, bool isRef = false, conststring initValue = "" ):19 Parameter( const std::string &varName, const Type &type, bool isRef = false, const std::string initValue = "" ): 18 20 Type( type ), 19 21 varName( varName ), … … 43 45 } 44 46 45 const st ring &GetVarName() const47 const std::string &GetVarName() const 46 48 { 47 49 return varName; … … 59 61 } 60 62 61 const st ring &GetInitValue() const63 const std::string &GetInitValue() const 62 64 { 63 65 return initValue; … … 89 91 }; 90 92 91 class Parameters : public vector<Parameter *>93 class Parameters : public std::vector<Parameter *> 92 94 { 93 95 public: -
trunk/jenga/include/smoothie/Procedure.h
r170 r181 94 94 string _paramStr; 95 95 96 pr ivate:96 protected: 97 97 bool isMacro; 98 98 … … 113 113 114 114 public: 115 116 void Serialize( bool isRead ) 117 { 118 119 } 115 120 116 121 UserProc( const string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport ): … … 127 132 { 128 133 } 129 ~UserProc(); 134 ~UserProc() 135 { 136 BOOST_FOREACH( Parameter *pParam, realParams ){ 137 delete pParam; 138 } 139 } 130 140 131 141 string GetFullName() const; … … 136 146 } 137 147 138 virtual bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine, bool isStatic ) ;148 virtual bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine, bool isStatic ) = 0; 139 149 140 150 int GetSecondParmNum() const … … 246 256 return *pCompilingUserProc; 247 257 } 248 };249 250 class GlobalProc : public UserProc251 {252 const NamespaceScopes namespaceScopes;253 const NamespaceScopesCollection importedNamespaces;254 public:255 // ハッシュリスト用256 GlobalProc *pNextData;257 258 GlobalProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport ):259 UserProc( name, kind, isMacro, isCdecl, isExport ),260 namespaceScopes( namespaceScopes ),261 importedNamespaces( importedNamespaces ),262 pNextData( NULL )263 {}264 ~GlobalProc(){}265 /*266 GlobalProc *Create( const NamespaceScopes &namespaceScopes, char *buffer,int nowLine );267 bool AddGlobalProc( const NamespaceScopes &namespaceScopes, char *buffer,int nowLine );268 */269 virtual const NamespaceScopes &GetNamespaceScopes() const;270 virtual const NamespaceScopesCollection &GetImportedNamespaces() const271 {272 return importedNamespaces;273 }274 275 virtual bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;276 virtual bool IsEqualSymbol( const GlobalProc &globalProc ) const;277 virtual bool IsEqualSymbol( const string &name ) const;278 258 }; 279 259 … … 309 289 } 310 290 311 virtual bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine ) ;291 virtual bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine ) = 0; 312 292 313 293 const string &GetDllFileName() const … … 339 319 ~ProcPointer(){} 340 320 341 virtual bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine ); 342 }; 321 virtual bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine ) = 0; 322 }; 323 class ProcPointers : public vector<ProcPointer *> 324 { 325 public: 326 ProcPointers() 327 { 328 } 329 ~ProcPointers() 330 { 331 } 332 333 virtual int Add( const string &typeExpression ) = 0; 334 }; -
trunk/jenga/include/smoothie/Smoothie.h
r174 r181 6 6 7 7 class Smoothie{ 8 static bool isUnicode; 9 10 static Meta meta; 8 11 public: 12 13 static bool IsUnicode() 14 { 15 return isUnicode; 16 } 17 static void SetUnicodeMark( bool isUnicode ) 18 { 19 Smoothie::isUnicode = isUnicode; 20 } 21 22 static Meta &GetMeta() 23 { 24 return meta; 25 } 9 26 10 27 class Lexical{ … … 12 29 static string baseProjectDirPath; 13 30 static BasicSource source; 14 static NamespaceScopes liveingNamespaceScopes;15 31 }; 16 32 … … 18 34 class Temp{ 19 35 public: 36 // 現在の名前空間 37 static NamespaceScopes liveingNamespaceScopes; 38 20 39 // 現在インポートされている名前空間 21 40 static NamespaceScopesCollection importedNamespaces; … … 28 47 }; 29 48 30 // プロジェクト中に存在するメタ情報31 static Meta meta;32 33 49 static bool isFullCompile; 34 50 }; -
trunk/jenga/include/smoothie/SmoothieException.h
r172 r181 14 14 , keyword( keyword ) 15 15 , nowLine( nowLine ) 16 { 17 } 18 SmoothieException( int errorCode, const std::string &keyword ) 19 : errorCode( errorCode ) 20 , keyword( keyword ) 21 , nowLine( -1 ) 16 22 { 17 23 }
Note:
See TracChangeset
for help on using the changeset viewer.