Changeset 107 in dev for BasicCompiler_Common
- Timestamp:
- May 6, 2007, 3:17:56 PM (18 years ago)
- Location:
- BasicCompiler_Common
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/BasicFixed.h
r99 r107 178 178 #define ESC_NAMESPACE 'o' // Namespace 179 179 #define ESC_ENDNAMESPACE 'p' // End Namespace 180 #define ESC_IMPORTS 'q' // Imports 181 #define ESC_CLEARNAMESPACEIMPORTED 'r' // _ClearNamespaceImported 180 182 //EXEファイル用制御エスケープシーケンス 181 #define ESC_USING ' q' // Print命令語のUsing182 #define ESC_FOR ' r' // Open命令語のFor183 #define ESC_LINENUM ' s' // 行番号を示す183 #define ESC_USING 's' // Print命令語のUsing 184 #define ESC_FOR 't' // Open命令語のFor 185 #define ESC_LINENUM 'u' // 行番号を示す 184 186 185 187 //オブジェクト指向エスケープシーケンス -
BasicCompiler_Common/Compile.cpp
r103 r107 229 229 } 230 230 Smoothie::Lexical::liveingNamespaceScopes.pop_back(); 231 break; 232 case ESC_IMPORTS: 233 Smoothie::Meta::importedNamespaces.Imports( Command + 2 ); 234 break; 235 case ESC_CLEARNAMESPACEIMPORTED: 236 Smoothie::Meta::importedNamespaces.clear(); 231 237 break; 232 238 -
BasicCompiler_Common/Intermediate_Step1.cpp
r99 r107 447 447 448 448 switch(temporary[i3]){ 449 case '_': 450 if(lstrcmpi(temporary+i3,"_ClearNamespaceImported")==0){ 451 i2=i3; 452 temporary[i2++]=1; 453 temporary[i2]=ESC_CLEARNAMESPACEIMPORTED; 454 } 455 break; 449 456 case 'a': 450 457 case 'A': … … 755 762 temporary[i2++]=1; 756 763 temporary[i2]=ESC_IF; 764 } 765 else if(lstrcmpi(temporary+i3,"Imports")==0){ 766 i2=i3; 767 temporary[i2++]=1; 768 temporary[i2]=ESC_IMPORTS; 757 769 } 758 770 else if(lstrcmpi(temporary+i3,"Inherits")==0){ -
BasicCompiler_Common/Intermediate_Step2.cpp
r103 r107 462 462 case ESC_STATIC: 463 463 case ESC_NAMESPACE: 464 case ESC_IMPORTS: 464 465 KillStringSpaces(Command+2); 465 466 break; -
BasicCompiler_Common/common.h
r100 r107 47 47 48 48 #ifdef _AMD64_ 49 #define VER_INFO "(x64) β rev.2 17"49 #define VER_INFO "(x64) β rev.228" 50 50 #else 51 #define VER_INFO "β rev.2 17"51 #define VER_INFO "β rev.228" 52 52 #endif 53 53 … … 61 61 62 62 63 #pragma comment(lib, "psapi.lib")64 65 66 63 #define PTR_SIZE sizeof(LONG_PTR) 67 64 … … 84 81 85 82 //未定義の定数情報 86 #define IMAGE_FILE_MACHINE_AMD64 0x8664 87 83 #ifndef IMAGE_FILE_MACHINE_AMD64 84 #define IMAGE_FILE_MACHINE_AMD64 0x8664 85 #endif 86 87 #ifdef _AMD64_ 88 #ifndef IMAGE_SIZEOF_NT_OPTIONAL64_HEADER 89 #define IMAGE_SIZEOF_NT_OPTIONAL64_HEADER 240 90 #endif 91 #else 92 #ifndef IMAGE_SIZEOF_NT_OPTIONAL32_HEADER 93 #define IMAGE_SIZEOF_NT_OPTIONAL32_HEADER 224 94 #endif 95 #endif 88 96 89 97 -
BasicCompiler_Common/error.cpp
r103 r107 152 152 if(num==62) sprintf(msg,"グローバル領域でのReturnは禁止されています。",tempKeyWord); 153 153 if(num==63) lstrcpy(msg,"名前空間が正しく閉じられていません。"); 154 if(num==64) sprintf(msg,"\"%s\" 無効な名前空間です。",tempKeyWord); 154 155 155 156 -
BasicCompiler_Common/include/Namespace.h
r105 r107 70 70 } 71 71 72 bool IsUsing() const 73 { 74 // TODO: 実装 75 return false; 76 } 72 bool IsImported() const; 77 73 78 74 bool IsLiving() const; … … 98 94 if( baseNamespaceScopes.size() ){ 99 95 // 名前空間の判断が必要なとき 100 if( baseNamespaceScopes.Is Using()96 if( baseNamespaceScopes.IsImported() 101 97 || baseNamespaceScopes.IsLiving() ){ 102 98 // Using指定があるとき … … 134 130 void SplitNamespace( const char *fullName, char *namespaceStr, char *simpleName ) const; 135 131 132 void Imports( const string &namespaceStr ); 133 136 134 static bool CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection ); 137 135 }; -
BasicCompiler_Common/include/Smoothie.h
r105 r107 19 19 #endif 20 20 } 21 static void Put( const string &text ){ 22 #ifdef _DEBUG 23 log += text + "\r\n"; 24 25 { 26 ofstream ofs( ( (string)BasicSystemDir + "Log\\compile.log" ).c_str(), ios_base::app ); 27 ofs << text << endl; 28 ofs.close(); 29 } 30 #endif 31 } 21 static void Put( const string &text ); 32 22 static void PutFile( const string &fileName, const string &buffer ){ 33 23 ofstream ofs( ( (string)BasicSystemDir + "Log\\" + fileName ).c_str() ); … … 49 39 static vector<ProcPointer *> procPointers; 50 40 static NamespaceScopesCollection namespaceScopesCollection; 41 static NamespaceScopesCollection importedNamespaces; 51 42 }; 52 43 }; -
BasicCompiler_Common/src/Namespace.cpp
r105 r107 21 21 } 22 22 23 bool NamespaceScopes::IsImported() const 24 { 25 BOOST_FOREACH( const NamespaceScopes &namespaceScopes, Smoothie::Meta::importedNamespaces ){ 26 if( this->IsEqual( namespaceScopes ) ){ 27 return true; 28 } 29 } 30 return false; 31 } 23 32 bool NamespaceScopes::IsLiving() const 24 33 { … … 90 99 lstrcpy( simpleName, fullName + lstrlen( namespaceStr ) + dotLength ); 91 100 } 101 void NamespaceScopesCollection::Imports( const string &namespaceStr ){ 102 NamespaceScopes namespaceScopes( namespaceStr ); 103 if( !Smoothie::Meta::namespaceScopesCollection.IsExist( namespaceScopes ) ){ 104 SetError(64,namespaceStr.c_str(),cp ); 105 return; 106 } 107 108 this->push_back( namespaceScopes ); 109 } 92 110 bool NamespaceScopesCollection::CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection ) 93 111 { -
BasicCompiler_Common/src/Smoothie.cpp
r105 r107 2 2 3 3 string Smoothie::Logger::log = ""; 4 5 void Smoothie::Logger::Put( const string &text ) 6 { 7 //#ifdef _DEBUG 8 log += text + "\r\n"; 9 10 { 11 ofstream ofs( ( (string)BasicSystemDir + "Log\\compile.log" ).c_str(), ios_base::app ); 12 ofs << text << endl; 13 ofs.close(); 14 } 15 //#endif 16 } 4 17 5 18 BasicSource Smoothie::Lexical::source; … … 9 22 vector<ProcPointer *> Smoothie::Meta::procPointers; 10 23 NamespaceScopesCollection Smoothie::Meta::namespaceScopesCollection; 24 NamespaceScopesCollection Smoothie::Meta::importedNamespaces;
Note:
See TracChangeset
for help on using the changeset viewer.