Changeset 182 in dev for trunk/abdev/BasicCompiler_Common/Compile.cpp
- Timestamp:
- Jun 24, 2007, 6:49:13 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/Compile.cpp
r143 r182 1 #include <jenga/include/smoothie/Smoothie.h> 2 #include <jenga/include/smoothie/LexicalAnalysis.h> 3 #include <jenga/include/smoothie/SmoothieException.h> 4 5 #include <LexicalScopingImpl.h> 6 #include <CodeGenerator.h> 7 1 8 #include "../BasicCompiler_Common/common.h" 2 9 … … 7 14 #endif 8 15 16 #include <Exception.h> 17 9 18 //ラベルアドレス 10 19 LABEL *pLabelNames; … … 33 42 WITHINFO WithInfo; 34 43 35 36 int obp,obp_AllocSize;37 int GlobalOpBufferSize;38 char *OpBuffer;39 void ReallocNativeCodeBuffer(){40 if(obp_AllocSize<obp+8192){41 obp_AllocSize+=8192;42 OpBuffer=(char *)HeapReAlloc(hHeap,0,OpBuffer,obp_AllocSize); //matea43 }44 }45 44 46 45 … … 177 176 break; 178 177 case ESC_EXITWHILE: 179 obj_LexScopes.ExitWhile(); 178 { 179 CScope *pScope = GetLexicalScopes().SearchScope( SCOPE_TYPE_WHILE ); 180 if( !pScope ){ 181 SetError(12,"Exit While",cp); 182 return; 183 } 184 pScope->Break(); 185 } 180 186 break; 181 187 case ESC_EXITFOR: 182 obj_LexScopes.ExitFor(); 188 { 189 CScope *pScope = GetLexicalScopes().SearchScope( SCOPE_TYPE_FOR ); 190 if( !pScope ){ 191 SetError(12,"Exit For",cp); 192 return; 193 } 194 pScope->Break(); 195 } 183 196 break; 184 197 case ESC_EXITDO: 185 obj_LexScopes.ExitDo(); 198 { 199 CScope *pScope = GetLexicalScopes().SearchScope( SCOPE_TYPE_DO ); 200 if( !pScope ){ 201 SetError(12,"Exit Do",cp); 202 return; 203 } 204 pScope->Break(); 205 } 186 206 break; 187 207 case ESC_CONTINUE: … … 231 251 232 252 case ESC_NAMESPACE: 233 Smoothie:: Lexical::liveingNamespaceScopes.push_back( Command + 2 );253 Smoothie::Temp::liveingNamespaceScopes.push_back( Command + 2 ); 234 254 break; 235 255 case ESC_ENDNAMESPACE: 236 if( Smoothie:: Lexical::liveingNamespaceScopes.size() <= 0 ){256 if( Smoothie::Temp::liveingNamespaceScopes.size() <= 0 ){ 237 257 SetError(12,"End Namespace",cp); 238 258 } 239 Smoothie:: Lexical::liveingNamespaceScopes.pop_back();259 Smoothie::Temp::liveingNamespaceScopes.pop_back(); 240 260 break; 241 261 case ESC_IMPORTS: … … 641 661 } 642 662 643 ChangeOpcode(Command); 663 try 664 { 665 ChangeOpcode(Command); 666 } 667 catch( const SmoothieException &smoothieException ) 668 { 669 SetError( 670 smoothieException.GetErrorCode(), 671 smoothieException.GetKeyword(), 672 smoothieException.GetNowLine() 673 ); 674 } 644 675 645 676 #ifdef _DEBUG … … 651 682 if(bStopCompile) return 0; 652 683 653 if(obp_AllocSize<obp+8192){ 654 obp_AllocSize+=8192; 655 OpBuffer=(char *)HeapReAlloc(hHeap,0,OpBuffer,obp_AllocSize); 656 } 684 ReallocNativeCodeBuffer(); 657 685 658 686 if(basbuf[cp]=='\0'){
Note:
See TracChangeset
for help on using the changeset viewer.