[170] | 1 | #include <jenga/include/smoothie/Member.h>
|
---|
| 2 |
|
---|
| 3 | CMember::CMember( CClass *pobj_c, Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine )
|
---|
| 4 | : MemberPrototype( accessibility )
|
---|
| 5 | {
|
---|
| 6 | extern int cp;
|
---|
| 7 |
|
---|
| 8 | //構文を解析
|
---|
| 9 | char VarName[VN_SIZE];
|
---|
| 10 | char initBuffer[VN_SIZE];
|
---|
| 11 | char lpszConstructParameter[VN_SIZE];
|
---|
| 12 | GetDimentionFormat(buffer,VarName,SubScripts,type,initBuffer,lpszConstructParameter);
|
---|
| 13 |
|
---|
| 14 | //重複チェック
|
---|
| 15 | if(pobj_c->DupliCheckAll(VarName)){
|
---|
| 16 | SetError(15,VarName,cp);
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | //メンバ名
|
---|
| 20 | name = VarName;
|
---|
| 21 |
|
---|
| 22 | //定数扱いかどうか
|
---|
| 23 | this->isConst = isConst;
|
---|
| 24 |
|
---|
| 25 | //初期データ
|
---|
| 26 | initializeExpression = initBuffer;
|
---|
| 27 |
|
---|
| 28 | //コンストラクタ用のパラメータ
|
---|
| 29 | constructParameter = lpszConstructParameter;
|
---|
| 30 |
|
---|
| 31 | //ソースコードの位置
|
---|
| 32 | source_code_address=nowLine;
|
---|
| 33 | }
|
---|
| 34 | CMember::CMember(CMember &member)
|
---|
| 35 | : MemberPrototype( member.GetAccessibility() )
|
---|
| 36 | , name( member.GetName() )
|
---|
| 37 | , type( member.GetType() )
|
---|
| 38 | , isConst( member.IsConst() )
|
---|
| 39 | {
|
---|
| 40 | //SubScripts
|
---|
| 41 | memcpy(SubScripts,member.SubScripts,MAX_ARRAYDIM*sizeof(int));
|
---|
| 42 |
|
---|
| 43 | //ソースコードの位置
|
---|
| 44 | source_code_address=member.source_code_address;
|
---|
| 45 | }
|
---|
| 46 | CMember::~CMember(){
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | void CMember::InitStaticMember(void){
|
---|
| 50 | //静的メンバをグローバル領域に作成
|
---|
| 51 |
|
---|
| 52 | //イテレータをリセット
|
---|
| 53 | extern Classes *pobj_DBClass;
|
---|
| 54 | pobj_DBClass->Iterator_Reset();
|
---|
| 55 |
|
---|
| 56 | int back_cp=cp;
|
---|
| 57 |
|
---|
| 58 | while(pobj_DBClass->Iterator_HasNext()){
|
---|
| 59 | CClass &objClass = *pobj_DBClass->Iterator_GetNext();
|
---|
| 60 |
|
---|
| 61 | // 名前空間をセット
|
---|
| 62 | Smoothie::Lexical::liveingNamespaceScopes = objClass.GetNamespaceScopes();
|
---|
| 63 |
|
---|
| 64 | int i=0;
|
---|
| 65 | BOOST_FOREACH( CMember *member, objClass.staticMembers ){
|
---|
| 66 | char temporary[VN_SIZE];
|
---|
| 67 | sprintf(temporary,"%s.%s",objClass.GetName().c_str(),member->GetName().c_str());
|
---|
| 68 | dim(
|
---|
| 69 | temporary,
|
---|
| 70 | member->SubScripts,
|
---|
| 71 | member->GetType(),
|
---|
| 72 | member->GetInitializeExpression().c_str(),
|
---|
| 73 | member->GetConstructParameter().c_str(),
|
---|
| 74 | 0);
|
---|
| 75 |
|
---|
| 76 | //ネイティブコードバッファの再確保
|
---|
| 77 | ReallocNativeCodeBuffer();
|
---|
| 78 |
|
---|
| 79 | i++;
|
---|
| 80 | }
|
---|
| 81 | }
|
---|
| 82 |
|
---|
| 83 | Smoothie::Lexical::liveingNamespaceScopes.clear();
|
---|
| 84 |
|
---|
| 85 | cp=back_cp;
|
---|
| 86 | }
|
---|