Changeset 194 in dev


Ignore:
Timestamp:
Jun 26, 2007, 1:48:03 PM (17 years ago)
Author:
dai_9181
Message:
 
Location:
trunk/jenga
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/jenga/include/smoothie/Namespace.h

    r192 r194  
    6969        return true;
    7070    }
    71 
    72     bool IsLiving() const;
    73 
    74     // 包括しているかをチェック
    75     // 例:
    76     // this =   "Discoversoft.ActiveBasic"
    77     // living = "Discoversoft.ActiveBasic"
    78     // name =   "ActiveBasic"
    79     // この場合、living は name を包括している。
    80     bool IsCoverd( const string &name ) const;
    81     bool IsCoverd( const NamespaceScopes &namespaceScopes ) const;
    8271};
    8372
     
    114103
    115104    void SplitNamespace( const char *fullName, char *namespaceStr, char *simpleName ) const;
    116 
    117     static bool CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection );
    118105};
  • trunk/jenga/include/smoothie/Smoothie.h

    r192 r194  
    2727    class Temp{
    2828    public:
    29         // 現在の名前空間
    30         static NamespaceScopes liveingNamespaceScopes;
    31 
    32         // 現在インポートされている名前空間
    33         static NamespaceScopesCollection importedNamespaces;
    34 
    3529        // コンパイル中のクラス
    3630        static const CClass *pCompilingClass;
  • trunk/jenga/src/smoothie/Namespace.cpp

    r192 r194  
    2525    }
    2626}
    27 
    28 bool NamespaceScopes::IsLiving() const
    29 {
    30     if( IsBelong( *this, Smoothie::Temp::liveingNamespaceScopes ) ){
    31         return true;
    32     }
    33     return false;
    34 }
    35 
    36 // 包括しているかをチェック
    37 // 例:
    38 // this =   "Discoversoft.ActiveBasic"
    39 // living = "Discoversoft.ActiveBasic"
    40 // name =   "ActiveBasic"
    41 // この場合、living は name を包括している。
    42 bool NamespaceScopes::IsCoverd( const string &name ) const
    43 {
    44     if( IsEqual( name ) ){
    45         return true;
    46     }
    47 
    48     string thisStr = ToString();
    49 
    50     NamespaceScopes tempLivingNamespaceScopes = Smoothie::Temp::liveingNamespaceScopes;
    51 
    52     while( tempLivingNamespaceScopes.size() ){
    53         NamespaceScopes tempNamespaceScopes = tempLivingNamespaceScopes;
    54 
    55         string tempStr = tempNamespaceScopes.ToString() + "." + name;
    56         if( thisStr == tempStr ){
    57             return true;
    58         }
    59 
    60         tempLivingNamespaceScopes.pop_back();
    61     }
    62     return false;
    63 }
    64 bool NamespaceScopes::IsCoverd( const NamespaceScopes &namespaceScopes ) const
    65 {
    66     return IsCoverd( namespaceScopes.ToString() );
    67 }
    68 
    6927
    7028void NamespaceScopesCollection::SplitNamespace( const char *fullName, char *namespaceStr, char *simpleName ) const
     
    9553    lstrcpy( simpleName, fullName + lstrlen( namespaceStr ) + dotLength );
    9654}
    97 bool NamespaceScopesCollection::CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection )
    98 {
    99     int i, i2;
    100     char temporary[1024];
    10155
    102     bool isSuccessful = true;
    103 
    104     // 名前空間管理
    105     NamespaceScopes namespaceScopes;
    106 
    107     for(i=0;;i++){
    108         if(source[i]=='\0') break;
    109 
    110         if( source[i] == 1 && source[i+1] == ESC_NAMESPACE ){
    111             for(i+=2,i2=0;;i2++,i++){
    112                 if( IsCommandDelimitation( source[i] ) ){
    113                     temporary[i2]=0;
    114                     break;
    115                 }
    116                 temporary[i2]=source[i];
    117             }
    118             namespaceScopes.push_back( temporary );
    119 
    120             if( !namespaceScopesCollection.IsExist( namespaceScopes ) ){
    121                 namespaceScopesCollection.push_back( namespaceScopes );
    122             }
    123 
    124             continue;
    125         }
    126         else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){
    127             if( namespaceScopes.size() <= 0 ){
    128                 SmoothieException::Throw( 12, "End Namespace", i );
    129                 isSuccessful = false;
    130             }
    131             else{
    132                 namespaceScopes.pop_back();
    133             }
    134 
    135             i += 2;
    136             continue;
    137         }
    138     }
    139 
    140     if( namespaceScopes.size() > 0 ){
    141         SmoothieException::Throw( 63 );
    142         isSuccessful = false;
    143     }
    144 
    145     return isSuccessful;
    146 }
  • trunk/jenga/src/smoothie/Smoothie.cpp

    r181 r194  
    33bool Smoothie::isUnicode = false;
    44BasicSource Smoothie::Lexical::source;
    5 NamespaceScopes Smoothie::Temp::liveingNamespaceScopes;
    65
    7 NamespaceScopesCollection Smoothie::Temp::importedNamespaces;
    86const CClass *Smoothie::Temp::pCompilingClass = NULL;
    97
Note: See TracChangeset for help on using the changeset viewer.