Changeset 581 in dev for trunk/ab5.0/abdev
- Timestamp:
- May 8, 2008, 3:52:48 PM (17 years ago)
- Location:
- trunk/ab5.0/abdev/BasicCompiler_Common
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/include/Delegate.h
r525 r581 39 39 } 40 40 41 const NamespaceScopesCollection &GetImportedNamespaces() const 42 { 43 return importedNamespaces; 44 } 45 41 46 const std::string &GetParamStr() const 42 47 { … … 47 52 return returnTypeName; 48 53 } 54 void SetReturnType( const Type &returnType ) 55 { 56 this->returnType = returnType; 57 } 49 58 50 void RefleshParameterAndReturnType(); 59 void SetSourceIndex( int sourceIndex ) 60 { 61 this->sourceIndex = sourceIndex; 62 } 51 63 52 64 virtual const std::string &GetKeyName() const … … 56 68 57 69 const Parameters &GetDynamicParams() const 70 { 71 return dynamicParams; 72 } 73 Parameters &GetDynamicParams() 58 74 { 59 75 return dynamicParams; -
trunk/ab5.0/abdev/BasicCompiler_Common/include/LexicalAnalyzer.h
r578 r581 66 66 static void CollectDelegates( const char *source, Delegates &delegates ); 67 67 static std::string GenerateDelegatesSourceCode( const Delegates &delegates ); 68 static void RefleshDelegateParameterAndReturnType( Delegate &dg ); 68 69 static void RefleshDelegatesParameterAndReturnType( Delegates &delegates ); 69 70 }; -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Delegate.cpp
r572 r581 2 2 3 3 #include <Delegate.h> 4 5 void Delegate::RefleshParameterAndReturnType()6 {7 compiler.GetNamespaceSupporter().SetImportedNamespaces( this->importedNamespaces );8 compiler.GetNamespaceSupporter().SetLivingNamespaceScopes( this->GetNamespaceScopes() );9 10 // パラメータを解析11 Jenga::Common::Strings parameterStrings;12 SplitParameter( paramStr, parameterStrings );13 ActiveBasic::Compiler::LexicalAnalyzer::AnalyzeParameter( this->GetParameters(), parameterStrings, sourceIndex );14 15 // 動的パラメータを作る16 dynamicParams = this->GetParameters();17 dynamicParams.insert( dynamicParams.begin(), new Parameter( "_System_LocalThis", Type( DEF_PTR_VOID ) ) );18 19 if( IsFunction() )20 {21 // 戻り値を取得22 if( !compiler.StringToType( returnTypeName, returnType ) )23 {24 compiler.errorMessenger.Output(3,returnTypeName,sourceIndex);25 }26 }27 }28 4 29 5 bool Delegate::IsSimilar( const Delegate &dgt ) const -
trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Delegate.cpp
r552 r581 213 213 } 214 214 215 void LexicalAnalyzer::RefleshDelegateParameterAndReturnType( Delegate &dg ) 216 { 217 compiler.GetNamespaceSupporter().SetImportedNamespaces( dg.GetImportedNamespaces() ); 218 compiler.GetNamespaceSupporter().SetLivingNamespaceScopes( dg.GetNamespaceScopes() ); 219 220 // パラメータを解析 221 Jenga::Common::Strings parameterStrings; 222 SplitParameter( dg.GetParamStr(), parameterStrings ); 223 int sourceIndex; 224 ActiveBasic::Compiler::LexicalAnalyzer::AnalyzeParameter( dg.GetParameters(), parameterStrings, sourceIndex ); 225 dg.SetSourceIndex( sourceIndex ); 226 227 // 動的パラメータを作る 228 dg.GetDynamicParams() = dg.GetParameters(); 229 dg.GetDynamicParams().insert( dg.GetDynamicParams().begin(), new Parameter( "_System_LocalThis", Type( DEF_PTR_VOID ) ) ); 230 231 if( dg.IsFunction() ) 232 { 233 // 戻り値を取得 234 Type returnType; 235 if( !compiler.StringToType( dg.GetReturnTypeName(), returnType ) ) 236 { 237 compiler.errorMessenger.Output(3,dg.GetReturnTypeName(),sourceIndex); 238 } 239 else 240 { 241 dg.SetReturnType( returnType ); 242 } 243 } 244 } 245 215 246 void LexicalAnalyzer::RefleshDelegatesParameterAndReturnType( Delegates &delegates ) 216 247 { … … 219 250 { 220 251 Delegate &dg = *delegates.Iterator_GetNext(); 221 dg.RefleshParameterAndReturnType();222 } 223 } 252 RefleshDelegateParameterAndReturnType( dg ); 253 } 254 }
Note:
See TracChangeset
for help on using the changeset viewer.