- Timestamp:
- May 7, 2008, 12:13:15 PM (17 years ago)
- Location:
- trunk/ab5.0/abdev/BasicCompiler_Common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/include/Procedure.h
r574 r575 542 542 } 543 543 544 int Add( const std::string &typeExpression );545 544 void Clear(); 546 545 void PullOutAll() -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp
r566 r575 78 78 if( typeName[0] == '*' ){ 79 79 if( typeName.size() >= 3 80 && typeName[1] == 1 && ( typeName[2] == ESC_FUNCTION || typeName[2] == ESC_SUB ) ){ 81 //関数ポインタ(*Function) 82 type.SetBasicType( DEF_PTR_PROC ); 83 type.SetIndex( this->GetObjectModule().meta.GetProcPointers().Add( typeName ) ); 84 return true; 80 && typeName[1] == 1 && ( typeName[2] == ESC_FUNCTION || typeName[2] == ESC_SUB ) ) 81 { 82 // 関数ポインタを追加する 83 { 84 DWORD dwProcType = (DWORD)typeName[2]; 85 const std::string ¶mStr = typeName.substr( 3 ); 86 87 Procedure::Kind kind = ( dwProcType == ESC_FUNCTION ) 88 ? Procedure::Function 89 : Procedure::Sub; 90 91 ProcPointer *pProcPointer = new ProcPointer( kind ); 92 93 //buffer[0]は'('となっている 94 extern int cp; 95 ActiveBasic::Compiler::LexicalAnalyzer::SetParamsAndReturnType( pProcPointer, paramStr.c_str(), false, cp ); 96 97 this->GetObjectModule().meta.GetProcPointers().push_back( pProcPointer ); 98 } 99 100 //関数ポインタ(*Function) 101 type.SetBasicType( DEF_PTR_PROC ); 102 type.SetIndex( this->GetObjectModule().meta.GetProcPointers().size() - 1 ); 103 return true; 85 104 } 86 105 -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Procedure.cpp
r574 r575 118 118 } 119 119 120 int ProcPointers::Add( const std::string &typeExpression )121 {122 DWORD dwProcType = (DWORD)typeExpression[2];123 const std::string ¶mStr = typeExpression.substr( 3 );124 125 Procedure::Kind kind = Procedure::Sub;126 if( dwProcType == ESC_FUNCTION ){127 kind = Procedure::Function;128 }129 130 ProcPointer *pProcPointer = new ProcPointer( kind );131 132 //buffer[0]は'('となっている133 extern int cp;134 LexicalAnalyzer::SetParamsAndReturnType( pProcPointer, paramStr.c_str(), false, cp );135 136 this->push_back( pProcPointer );137 138 return (int)this->size()-1;139 }140 141 120 void ProcPointers::Clear() 142 121 {
Note:
See TracChangeset
for help on using the changeset viewer.