- Timestamp:
- Jun 26, 2007, 1:48:03 PM (17 years ago)
- Location:
- trunk/jenga
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jenga/include/smoothie/Namespace.h
r192 r194 69 69 return true; 70 70 } 71 72 bool IsLiving() const;73 74 // 包括しているかをチェック75 // 例:76 // this = "Discoversoft.ActiveBasic"77 // living = "Discoversoft.ActiveBasic"78 // name = "ActiveBasic"79 // この場合、living は name を包括している。80 bool IsCoverd( const string &name ) const;81 bool IsCoverd( const NamespaceScopes &namespaceScopes ) const;82 71 }; 83 72 … … 114 103 115 104 void SplitNamespace( const char *fullName, char *namespaceStr, char *simpleName ) const; 116 117 static bool CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection );118 105 }; -
trunk/jenga/include/smoothie/Smoothie.h
r192 r194 27 27 class Temp{ 28 28 public: 29 // 現在の名前空間30 static NamespaceScopes liveingNamespaceScopes;31 32 // 現在インポートされている名前空間33 static NamespaceScopesCollection importedNamespaces;34 35 29 // コンパイル中のクラス 36 30 static const CClass *pCompilingClass; -
trunk/jenga/src/smoothie/Namespace.cpp
r192 r194 25 25 } 26 26 } 27 28 bool NamespaceScopes::IsLiving() const29 {30 if( IsBelong( *this, Smoothie::Temp::liveingNamespaceScopes ) ){31 return true;32 }33 return false;34 }35 36 // 包括しているかをチェック37 // 例:38 // this = "Discoversoft.ActiveBasic"39 // living = "Discoversoft.ActiveBasic"40 // name = "ActiveBasic"41 // この場合、living は name を包括している。42 bool NamespaceScopes::IsCoverd( const string &name ) const43 {44 if( IsEqual( name ) ){45 return true;46 }47 48 string thisStr = ToString();49 50 NamespaceScopes tempLivingNamespaceScopes = Smoothie::Temp::liveingNamespaceScopes;51 52 while( tempLivingNamespaceScopes.size() ){53 NamespaceScopes tempNamespaceScopes = tempLivingNamespaceScopes;54 55 string tempStr = tempNamespaceScopes.ToString() + "." + name;56 if( thisStr == tempStr ){57 return true;58 }59 60 tempLivingNamespaceScopes.pop_back();61 }62 return false;63 }64 bool NamespaceScopes::IsCoverd( const NamespaceScopes &namespaceScopes ) const65 {66 return IsCoverd( namespaceScopes.ToString() );67 }68 69 27 70 28 void NamespaceScopesCollection::SplitNamespace( const char *fullName, char *namespaceStr, char *simpleName ) const … … 95 53 lstrcpy( simpleName, fullName + lstrlen( namespaceStr ) + dotLength ); 96 54 } 97 bool NamespaceScopesCollection::CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection )98 {99 int i, i2;100 char temporary[1024];101 55 102 bool isSuccessful = true;103 104 // 名前空間管理105 NamespaceScopes namespaceScopes;106 107 for(i=0;;i++){108 if(source[i]=='\0') break;109 110 if( source[i] == 1 && source[i+1] == ESC_NAMESPACE ){111 for(i+=2,i2=0;;i2++,i++){112 if( IsCommandDelimitation( source[i] ) ){113 temporary[i2]=0;114 break;115 }116 temporary[i2]=source[i];117 }118 namespaceScopes.push_back( temporary );119 120 if( !namespaceScopesCollection.IsExist( namespaceScopes ) ){121 namespaceScopesCollection.push_back( namespaceScopes );122 }123 124 continue;125 }126 else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){127 if( namespaceScopes.size() <= 0 ){128 SmoothieException::Throw( 12, "End Namespace", i );129 isSuccessful = false;130 }131 else{132 namespaceScopes.pop_back();133 }134 135 i += 2;136 continue;137 }138 }139 140 if( namespaceScopes.size() > 0 ){141 SmoothieException::Throw( 63 );142 isSuccessful = false;143 }144 145 return isSuccessful;146 } -
trunk/jenga/src/smoothie/Smoothie.cpp
r181 r194 3 3 bool Smoothie::isUnicode = false; 4 4 BasicSource Smoothie::Lexical::source; 5 NamespaceScopes Smoothie::Temp::liveingNamespaceScopes;6 5 7 NamespaceScopesCollection Smoothie::Temp::importedNamespaces;8 6 const CClass *Smoothie::Temp::pCompilingClass = NULL; 9 7
Note:
See TracChangeset
for help on using the changeset viewer.