Changeset 137 in dev for BasicCompiler_Common/include
- Timestamp:
- Jun 8, 2007, 3:11:47 AM (17 years ago)
- Location:
- BasicCompiler_Common/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/include/Member.h
r136 r137 10 10 class CClass; 11 11 12 class CMember : public Type12 class CMember : public MemberPrototype 13 13 { 14 14 string name; 15 Type type; 15 16 bool isConst; 16 17 public: 17 18 int SubScripts[MAX_ARRAYDIM]; 18 19 DWORD dwAccess;20 19 21 20 char *InitBuf; … … 33 32 } 34 33 34 Type GetType() const 35 { 36 return type; 37 } 38 35 39 bool IsConst() 36 40 { … … 38 42 } 39 43 40 CMember() 44 CMember( Prototype::Accessibility accessibility, const string &name, const Type &type, bool isConst ) 45 : MemberPrototype( accessibility ) 46 , name( name ) 47 , type( type ) 48 , isConst( isConst ) 41 49 { 42 50 } 43 CMember( CClass *pobj_c, DWORD access, bool idConst, bool isRef, char *buffer, int nowLine=-1 );51 CMember( CClass *pobj_c, Prototype::Accessibility accessibility, bool idConst, bool isRef, char *buffer, int nowLine=-1 ); 44 52 CMember( CMember &member ); 45 53 ~CMember(); -
BasicCompiler_Common/include/Method.h
r136 r137 4 4 #include <vector> 5 5 6 #include "../Class.h" 6 7 #include <windows.h> 7 8 … … 12 13 void SetError(); 13 14 14 class CMethod 15 class CMethod : public MemberPrototype 15 16 { 16 17 public: 17 18 UserProc *pUserProc; 18 DWORD dwAccess;19 19 20 CMethod( UserProc *pUserProc, DWORD dwAccess)21 : pUserProc( pUserProc)22 , dwAccess( dwAccess)20 CMethod( UserProc *pUserProc, Prototype::Accessibility accessibility ) 21 : MemberPrototype( accessibility ) 22 , pUserProc( pUserProc ) 23 23 { 24 24 } … … 41 41 42 42 public: 43 DynamicMethod( UserProc *pUserProc, DWORD dwAccess, bool isAbstract, bool isVirtual, bool isConst, const CClass *pInheritsClass = NULL )44 : CMethod( pUserProc, dwAccess)43 DynamicMethod( UserProc *pUserProc, Prototype::Accessibility accessibility, bool isAbstract, bool isVirtual, bool isConst, const CClass *pInheritsClass = NULL ) 44 : CMethod( pUserProc, accessibility ) 45 45 , isAbstract( isAbstract ) 46 46 , isVirtual( isVirtual ) … … 50 50 } 51 51 DynamicMethod( const CMethod &method ) 52 : CMethod( method.pUserProc, method. dwAccess)52 : CMethod( method.pUserProc, method.GetAccessibility() ) 53 53 , isAbstract( method.IsAbstract() ) 54 54 , isVirtual( method.IsVirtual() ) … … 90 90 { 91 91 public: 92 StaticMethod( UserProc *pUserProc, DWORD dwAccess)93 : CMethod( pUserProc, dwAccess)92 StaticMethod( UserProc *pUserProc, Prototype::Accessibility accessibility ) 93 : CMethod( pUserProc, accessibility ) 94 94 { 95 95 } … … 116 116 117 117 //メンバ、メソッドの追加 118 void Add( UserProc *pUserProc, DWORD dwAccess, bool isConst, bool isAbstract, bool isVirtual );119 void AddStatic(UserProc *pUserProc, DWORD dwAccess);118 void Add( UserProc *pUserProc, Prototype::Accessibility accessibility, bool isConst, bool isAbstract, bool isVirtual ); 119 void AddStatic(UserProc *pUserProc,Prototype::Accessibility accessibility); 120 120 121 121 const CMethod *GetMethodPtr( UserProc *pUserProc ) const; -
BasicCompiler_Common/include/Prototype.h
r135 r137 13 13 class Prototype 14 14 { 15 public: 16 enum Accessibility{ 17 None, 18 Private, 19 Protected, 20 Public, 21 }; 22 23 private: 15 24 // 名前空間 16 25 NamespaceScopes namespaceScopes; … … 69 78 70 79 }; 80 81 class MemberPrototype 82 { 83 Prototype::Accessibility accessibility; 84 public: 85 MemberPrototype( Prototype::Accessibility accessibility ) 86 : accessibility( accessibility ) 87 { 88 } 89 90 Prototype::Accessibility GetAccessibility() const 91 { 92 return accessibility; 93 } 94 void SetAccessibility( Prototype::Accessibility accessibility ){ 95 this->accessibility = accessibility; 96 } 97 98 bool IsNoneAccess() const 99 { 100 return ( accessibility == Prototype::None ); 101 } 102 bool IsPrivate() const 103 { 104 return ( accessibility == Prototype::Private ); 105 } 106 bool IsProtected() const 107 { 108 return ( accessibility == Prototype::Protected ); 109 } 110 bool IsPublic() const 111 { 112 return ( accessibility == Prototype::Public ); 113 } 114 };
Note:
See TracChangeset
for help on using the changeset viewer.