Changeset 461 in dev for trunk/ab5.0/abdev/BasicCompiler_Common
- Timestamp:
- Mar 23, 2008, 11:35:33 AM (17 years ago)
- Location:
- trunk/ab5.0/abdev/BasicCompiler_Common
- Files:
-
- 2 deleted
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.cpp
r459 r461 4 4 5 5 #include <jenga/include/common/Path.h> 6 7 #include <jenga/include/smoothie/Smoothie.h>8 6 9 7 #include <Program.h> … … 647 645 { 648 646 // Unicode 649 Smoothie::SetUnicodeMark( true );647 compiler.SetUnicodeMark( true ); 650 648 typeOfPtrChar = MAKE_PTR_TYPE(DEF_WORD,1); 651 649 typeOfPtrUChar = MAKE_PTR_TYPE(DEF_WORD,1); -
trunk/ab5.0/abdev/BasicCompiler_Common/Compile.cpp
r459 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 #include <jenga/include/smoothie/SmoothieException.h>5 2 6 3 #include <LexicalScope.h> … … 764 761 } 765 762 766 try 767 { 768 ChangeOpcode(Command); 769 } 770 catch( const SmoothieException &smoothieException ) 771 { 772 SetError( 773 smoothieException.GetErrorCode(), 774 smoothieException.GetKeyword(), 775 smoothieException.GetNowLine() 776 ); 777 } 763 ChangeOpcode(Command); 778 764 779 765 -
trunk/ab5.0/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
r313 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 2 5 3 #include <Compiler.h> -
trunk/ab5.0/abdev/BasicCompiler_Common/Diagnose.cpp
r342 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 2 5 3 #include <Compiler.h> -
trunk/ab5.0/abdev/BasicCompiler_Common/Intermediate_Step1.cpp
r459 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 2 5 3 #include <Compiler.h> … … 314 312 } 315 313 SlideString(basbuf+i2,i-i2); 316 }317 else if( lstrcmpi( temporary, "_fullcompile" ) == 0 ){318 // すべての関数・メソッドをコンパイルする(デバッグ用)319 for(;;i2++){320 if(basbuf[i2]=='\n'||basbuf[i2]=='\0') break;321 }322 SlideString(basbuf+i2,i-i2);323 324 Smoothie::isFullCompile = true;325 314 } 326 315 else if(lstrcmpi(temporary,"resource")==0){ -
trunk/ab5.0/abdev/BasicCompiler_Common/Intermediate_Step2.cpp
r402 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 2 5 3 #include <Compiler.h> -
trunk/ab5.0/abdev/BasicCompiler_Common/MakeExe.cpp
r459 r461 1 1 #include "stdafx.h" 2 2 3 #include <jenga/include/smoothie/Smoothie.h>4 3 #include <jenga/include/common/Path.h> 5 4 -
trunk/ab5.0/abdev/BasicCompiler_Common/NumOpe_GetType.cpp
r428 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 2 5 3 #include <Compiler.h> -
trunk/ab5.0/abdev/BasicCompiler_Common/Subroutine.cpp
r402 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 2 5 3 #include <Compiler.h> -
trunk/ab5.0/abdev/BasicCompiler_Common/VarList.cpp
r409 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 2 5 3 #include <Compiler.h> -
trunk/ab5.0/abdev/BasicCompiler_Common/VariableOpe.cpp
r429 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 2 5 3 #include <Compiler.h> … … 118 116 return DEF_QWORD; 119 117 case DEF_CHAR: 120 if( Smoothie::IsUnicode() ) return DEF_WORD;118 if( compiler.IsUnicode() ) return DEF_WORD; 121 119 return DEF_BYTE; 122 120 } -
trunk/ab5.0/abdev/BasicCompiler_Common/WatchList.cpp
r409 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 2 5 3 #include <Compiler.h> -
trunk/ab5.0/abdev/BasicCompiler_Common/common.h
r431 r461 18 18 #endif 19 19 20 #include <jenga/include/smoothie/BasicFixed.h>21 20 #include "../BasicCompiler_Common/NonVolatile.h" 22 21 #include "../BasicCompiler_Common/psapi.h" -
trunk/ab5.0/abdev/BasicCompiler_Common/hash.cpp
r415 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 2 5 3 #include <Compiler.h> -
trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h
r459 r461 33 33 bool isDebug; 34 34 35 // Unicode対応モジュールかどうか 36 bool isUnicode; 37 35 38 // 名前空間サポート 36 39 NamespaceSupporter namespaceSupporter; … … 47 50 , targetModuleType( Exe ) 48 51 , isDebug( false ) 52 , isUnicode( false ) 49 53 , isCore( false ) 50 54 { … … 142 146 } 143 147 148 void SetUnicodeMark( bool isUnicode ) 149 { 150 this->isUnicode = isUnicode; 151 } 152 bool IsUnicode() 153 { 154 return isUnicode; 155 } 156 144 157 145 158 // コアモジュールかどうか -
trunk/ab5.0/abdev/BasicCompiler_Common/include/LexicalScope.h
r248 r461 1 1 #pragma once 2 3 #include <jenga/include/smoothie/Smoothie.h>4 2 5 3 #include <CodeGenerator.h> -
trunk/ab5.0/abdev/BasicCompiler_Common/include/Parameter.h
r448 r461 3 3 #include <string> 4 4 #include <vector> 5 6 #include <jenga/include/smoothie/BasicFixed.h>7 5 8 6 #include <option.h> -
trunk/ab5.0/abdev/BasicCompiler_Common/include/Source.h
r322 r461 9 9 10 10 #include <jenga/include/common/Exception.h> 11 #include <jenga/include/smoothie/BasicFixed.h>12 11 13 12 #include <BoostSerializationSupport.h> -
trunk/ab5.0/abdev/BasicCompiler_Common/include/Type.h
r448 r461 8 8 #include <jenga/include/common/Exception.h> 9 9 #include <BoostSerializationSupport.h> 10 #include <jenga/include/smoothie/BasicFixed.h>11 10 12 11 #include <option.h> -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp
r447 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 #include <jenga/include/smoothie/SmoothieException.h>5 2 6 3 #include <Source.h> … … 202 199 const CClass *pInheritsClass = compiler.GetObjectModule().meta.GetClasses().Find(className); 203 200 if( !pInheritsClass ){ 204 S moothieException::Throw(106,className,nowLine);201 SetError(106,className,nowLine); 205 202 return false; 206 203 } … … 239 236 if( !compiler.GetObjectModule().meta.GetClasses().LoopRefCheck(inheritsClass) ) 240 237 { 241 S moothieException::Throw(123,inheritsClass.GetName(),nowLine);238 SetError(123,inheritsClass.GetName(),nowLine); 242 239 return false; 243 240 } … … 1468 1465 pCompilingMethod = pParentClass->GetStaticMethods().GetMethodPtr( pUserProc ); 1469 1466 if( !pCompilingMethod ){ 1470 S moothieException::Throw(300);1467 SetError(); 1471 1468 } 1472 1469 } -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Class_Collect.cpp
r424 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 #include <jenga/include/smoothie/SmoothieException.h>5 2 6 3 #include <Source.h> … … 105 102 else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){ 106 103 if( namespaceScopes.size() <= 0 ){ 107 S moothieException::Throw(12, "End Namespace", i );104 SetError(12, "End Namespace", i ); 108 105 } 109 106 else{ … … 124 121 if( !compiler.GetNamespaceSupporter().ImportsNamespace( temporary ) ) 125 122 { 126 S moothieException::Throw(64,temporary,i );123 SetError(64,temporary,i ); 127 124 } 128 125 … … 306 303 if( !compiler.GetNamespaceSupporter().ImportsNamespace( temporary ) ) 307 304 { 308 S moothieException::Throw(64,temporary,i );305 SetError(64,temporary,i ); 309 306 } 310 307 -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp
r424 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/SmoothieException.h>4 2 5 3 #include <Compiler.h> … … 208 206 } 209 207 210 S moothieException::Throw( 1);208 SetError(1, NULL, cp); 211 209 212 210 return (string)"(null)"; -
trunk/ab5.0/abdev/BasicCompiler_Common/src/DataTable.cpp
r417 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 2 5 3 #include <DataTable.h> … … 39 37 int retSize = size; 40 38 41 if( Smoothie::IsUnicode() ){39 if( compiler.IsUnicode() ){ 42 40 //Shift-JIS → Unicode 43 41 int size = MultiByteToWideChar( -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Namespace.cpp
r217 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/BasicFixed.h>4 #include <jenga/include/smoothie/Smoothie.h>5 #include <jenga/include/smoothie/SmoothieException.h>6 2 7 3 #include <Namespace.h> -
trunk/ab5.0/abdev/BasicCompiler_Common/src/NamespaceSupporter.cpp
r402 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/SmoothieException.h>4 2 5 3 #include <Compiler.h> … … 48 46 else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){ 49 47 if( namespaceScopes.size() <= 0 ){ 50 S moothieException::Throw( 12, "End Namespace", i );48 SetError( 12, "End Namespace", i ); 51 49 isSuccessful = false; 52 50 } … … 61 59 62 60 if( namespaceScopes.size() > 0 ){ 63 S moothieException::Throw( 63);61 SetError( 63, NULL, cp ); 64 62 isSuccessful = false; 65 63 } -
trunk/ab5.0/abdev/BasicCompiler_Common/src/ObjectModule.cpp
r404 r461 18 18 19 19 #include "../common.h" 20 #include "../BasicFixed.h" 20 21 21 22 -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Procedure.cpp
r447 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 #include <jenga/include/smoothie/SmoothieException.h>5 2 6 3 #include <Compiler.h> … … 251 248 252 249 if( type.IsNull() ){ 253 S moothieException::Throw(3,temporary,nowLine);250 SetError(3,temporary,nowLine); 254 251 type.SetBasicType( DEF_PTR_VOID ); 255 252 } … … 328 325 if(sw){ 329 326 //配列パラメータ 330 if( isRef == false ) S moothieException::Throw(29,NULL,nowLine);327 if( isRef == false ) SetError(29,NULL,nowLine); 331 328 isArray = true; 332 329 … … 392 389 393 390 if( type.IsNull() ){ 394 S moothieException::Throw(3,temporary,nowLine);391 SetError(3,temporary,nowLine); 395 392 type.SetBasicType( DEF_PTR_VOID ); 396 393 } … … 405 402 else{ 406 403 type.SetBasicType( Type::GetBasicTypeFromSimpleName(temporary) ); 407 S moothieException::Throw(-103,temporary,nowLine);404 SetError(-103,temporary,nowLine); 408 405 } 409 406 … … 655 652 UserProc *pUserProc = new UserProc( namespaceScopes, importedNamespaces, temporary, kind, isMacro, isCdecl, isExport, (id_base++) ); 656 653 pUserProc->SetParentClass( pobj_c ); 657 if( Smoothie::isFullCompile ){658 // すべての関数・メソッドをコンパイルする659 pUserProc->Using();660 }661 654 662 655 // 親インターフェイスをセット … … 772 765 if(sw){ 773 766 //配列パラメータ 774 if( isRef == false ) S moothieException::Throw(29,NULL,nowLine);767 if( isRef == false ) SetError(29,NULL,nowLine); 775 768 isArray = true; 776 769 … … 818 811 819 812 if( type.IsNull() ){ 820 S moothieException::Throw(3,temporary,nowLine);813 SetError(3,temporary,nowLine); 821 814 type.SetBasicType( DEF_PTR_VOID ); 822 815 } … … 824 817 else{ 825 818 type.SetBasicType( Type::GetBasicTypeFromSimpleName(temporary) ); 826 S moothieException::Throw(-103,temporary,nowLine);819 SetError(-103,temporary,nowLine); 827 820 } 828 821 … … 870 863 } 871 864 compiler.StringToType( temporary, this->returnType ); 872 if( this->returnType.IsNull() ) S moothieException::Throw(3,temporary,nowLine);865 if( this->returnType.IsNull() ) SetError(3,temporary,nowLine); 873 866 874 867 sw_as=1; … … 1066 1059 if(sw){ 1067 1060 //配列パラメータ 1068 if( isRef == false ) S moothieException::Throw(29,NULL,nowLine);1061 if( isRef == false ) SetError(29,NULL,nowLine); 1069 1062 isArray = true; 1070 1063 … … 1111 1104 1112 1105 if( type.IsNull() ){ 1113 S moothieException::Throw(3,temporary,nowLine);1106 SetError(3,temporary,nowLine); 1114 1107 type.SetBasicType( DEF_PTR_VOID ); 1115 1108 } … … 1117 1110 else{ 1118 1111 type.SetBasicType( Type::GetBasicTypeFromSimpleName(temporary) ); 1119 S moothieException::Throw(-103,temporary,nowLine);1112 SetError(-103,temporary,nowLine); 1120 1113 } 1121 1114 … … 1163 1156 } 1164 1157 compiler.StringToType( temporary, this->returnType ); 1165 if( this->returnType.IsNull() ) S moothieException::Throw(3,temporary,nowLine);1158 if( this->returnType.IsNull() ) SetError(3,temporary,nowLine); 1166 1159 1167 1160 sw_as=1; … … 1181 1174 if( this->ReturnType().IsNull() ){ 1182 1175 // 戻り値がない 1183 S moothieException::Throw(26,this->GetName(),nowLine);1176 SetError(26,this->GetName(),nowLine); 1184 1177 } 1185 1178 } … … 1187 1180 if( !this->ReturnType().IsNull() ){ 1188 1181 // Sub定義なのに、戻り値がある 1189 S moothieException::Throw(38,this->GetName(),nowLine);1182 SetError(38,this->GetName(),nowLine); 1190 1183 } 1191 1184 } -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Source.cpp
r459 r461 5 5 #include <jenga/include/common/Directory.h> 6 6 #include <jenga/include/common/Path.h> 7 8 #include <jenga/include/smoothie/Smoothie.h>9 #include <jenga/include/smoothie/BasicFixed.h>10 #include <jenga/include/smoothie/SmoothieException.h>11 7 12 8 #include <Source.h> … … 130 126 } 131 127 132 if( Smoothie::IsUnicode() )128 if( compiler.IsUnicode() ) 133 129 { 134 130 add( "UNICODE" ); … … 682 678 if( !source.ReadFile_InIncludeDirective( temporary ) ){ 683 679 sprintf(temp2,"インクルードファイル \"%s\" をオープンできません",temporary); 684 S moothieException::Throw(-1,temp2,i);680 SetError(-1,temp2,i); 685 681 break; 686 682 } -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Symbol.cpp
r402 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/BasicFixed.h>4 2 5 3 #include <Compiler.h> -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Type.cpp
r448 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 #include <jenga/include/smoothie/SmoothieException.h>5 2 6 3 #include <Class.h> … … 119 116 } 120 117 121 S moothieException::Throw();118 SetError(); 122 119 123 120 return 0; … … 222 219 { 223 220 if( !pClass ){ 224 S moothieException::Throw();221 SetError(); 225 222 return 0; 226 223 } … … 235 232 } 236 233 237 S moothieException::Throw();234 SetError(); 238 235 return 0; 239 236 } -
trunk/ab5.0/abdev/BasicCompiler_Common/src/TypeDef.cpp
r402 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 #include <jenga/include/smoothie/SmoothieException.h>5 2 6 3 #include <TypeDef.h> … … 13 10 { 14 11 if( !compiler.StringToType( baseName, baseType ) ){ 15 S moothieException::Throw(3, baseName, nowLine );12 SetError(3, baseName, nowLine ); 16 13 return; 17 14 } … … 90 87 91 88 if(expression[i]!='='){ 92 S moothieException::Throw(10,"TypeDef",nowLine);89 SetError(10,"TypeDef",nowLine); 93 90 return; 94 91 } … … 101 98 if(temporary[i]=='\0') break; 102 99 if( !( IsVariableChar( temporary[i], true) ) ){ 103 S moothieException::Throw(10,"TypeDef",nowLine);100 SetError(10,"TypeDef",nowLine); 104 101 return; 105 102 } … … 110 107 //関数ポインタ 111 108 if(pTemp[3]!='('){ 112 S moothieException::Throw(10,"TypeDef",nowLine);109 SetError(10,"TypeDef",nowLine); 113 110 return; 114 111 } … … 121 118 if( !( IsVariableChar( pTemp[i], true) ) ) 122 119 { 123 S moothieException::Throw(10,"TypeDef",nowLine);120 SetError(10,"TypeDef",nowLine); 124 121 return; 125 122 } … … 173 170 else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){ 174 171 if( namespaceScopes.size() <= 0 ){ 175 S moothieException::Throw(12, "End Namespace", i );172 SetError(12, "End Namespace", i ); 176 173 } 177 174 else{ … … 192 189 if( !compiler.GetNamespaceSupporter().ImportsNamespace( temporary ) ) 193 190 { 194 S moothieException::Throw(64,temporary,i );191 SetError(64,temporary,i ); 195 192 } 196 193 -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Variable.cpp
r392 r461 1 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/Smoothie.h>4 2 5 3 #include <Compiler.h>
Note:
See TracChangeset
for help on using the changeset viewer.